summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/ImplRepo_Service/INS_Locator.h
blob: a948ea478d530b15e73dbcb42b1e79477b65671c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// -*- C++ -*-
//=============================================================================
/**
 *  @file   INS_Locator.h
 *
 *  @brief  This class implements the ImR's INS Locator class
 *
 *  @author Darrell Brunsch <brunsch@cs.wustl.edu>
 */
//=============================================================================

#ifndef IMR_INS_LOCATOR_H
#define IMR_INS_LOCATOR_H
#include /**/ "ace/pre.h"

#include "tao/IORTable/Async_IORTable.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "tao/LocalObject.h"
#include "ImR_ResponseHandler.h"
#include "tao/IORTable/Locate_ResponseHandler.h"

class ImR_Locator_i;

class INS_Loc_ResponseHandler : public ImR_ResponseHandler
{
public:
  INS_Loc_ResponseHandler (const char *key, ::IORTable::Locate_ResponseHandler rh);

  // dummy implementations used for internal operations
  virtual void send_ior (const char *pior);
  virtual void send_exception (CORBA::Exception *ex);

private:
  CORBA::String_var key_str_;
  TAO_AMH_Locate_ResponseHandler_var rh_;
};

/**
 * @class INS_Locator
 *
 * @brief Implementation Repository INS Locator class
 *
 * This class provides a callback for the IORTable to call when it needs
 * to dynamically receive a IOR to forward in response to an INS request.
 */
class INS_Locator
  : public virtual IORTable::AsyncLocator,
    public virtual ::CORBA::LocalObject
{
public:
  INS_Locator (ImR_Locator_i& loc);

  /// Locate the appropriate IOR.
  char* locate (const char *object_key);
  void async_locate (::IORTable::Locate_ResponseHandler handler,
                     const char *object_key);

private:
  ImR_Locator_i& imr_locator_;
};

#include /**/ "ace/post.h"
#endif