3 //=============================================================================
5 * @file Adapter_Registry.h
7 * @author Carlos O'Ryan (coryan@uci.edu)
9 //=============================================================================
11 #ifndef TAO_ADAPTER_REGISTRY_H
12 #define TAO_ADAPTER_REGISTRY_H
14 #include /**/ "ace/pre.h"
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
20 #include "tao/CORBA_methods.h"
24 #pragma warning(disable:4250)
27 #include "tao/Pseudo_VarOut_T.h"
29 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
33 typedef TAO_Pseudo_Var_T
<Object
> Object_var
;
34 typedef TAO_Pseudo_Out_T
<Object
> Object_out
;
45 class TAO_ServerRequest
;
48 class TAO_Export TAO_Adapter_Registry
51 explicit TAO_Adapter_Registry (TAO_ORB_Core
*);
54 ~TAO_Adapter_Registry ();
57 * Close each of of the Adapters and then cleanup the Registry.
58 * It is possible that an Adapter will reject a close() call if it
59 * is invoked in an inappropriate context (think shutting down the
60 * POA while performing an upcall).
62 void close (int wait_for_completion
);
65 * Verify if the close() call can be invoked in the current
66 * context for *all* adapters.
67 * Raise the right exception if not.
69 void check_close (int wait_for_completion
);
71 /// Insert a new adapter into the registry.
72 void insert (TAO_Adapter
*adapter
);
75 * Dispatch the request to all the adapters.
76 * It tries the adapters ordered by priority, stopping when the
77 * adapter returns a status different from DS_MISMATCHED_KEY
79 void dispatch (TAO::ObjectKey
&key
,
80 TAO_ServerRequest
&request
,
81 CORBA::Object_out forward_to
);
83 /// Create a collocated object using the given profile and stub.
84 CORBA::Object_ptr
create_collocated_object (TAO_Stub
*, const TAO_MProfile
&);
86 /// Initialize a collocated object using the given stub and object
87 /// pointer for lazily evaluated object references.
88 CORBA::Long
initialize_collocated_object (TAO_Stub
*);
90 /// Fetch the adapter named @a name
91 TAO_Adapter
*find_adapter (const char *name
) const;
94 TAO_Adapter_Registry (const TAO_Adapter_Registry
&) = delete;
95 TAO_Adapter_Registry
&operator= (const TAO_Adapter_Registry
&) = delete;
98 * @name A simple array of adapters.
101 size_t adapters_capacity_
;
102 size_t adapters_count_
;
103 TAO_Adapter
**adapters_
;
107 TAO_END_VERSIONED_NAMESPACE_DECL
109 #if defined(_MSC_VER)
111 #endif /* _MSC_VER */
113 #include /**/ "ace/post.h"
115 #endif /* TAO_ADAPTER_REGISTRY_H */