3 //=============================================================================
5 * @file Acceptor_Registry.h
7 * Interface for the TAO pluggable protocol framework.
9 * @author Fred Kuhns <fredk@cs.wustl.edu>
10 * @author Ossama Othman <ossama@uci.edu>
12 //=============================================================================
14 #ifndef TAO_ACCEPTOR_REGISTRY_H
15 #define TAO_ACCEPTOR_REGISTRY_H
17 #include /**/ "ace/pre.h"
18 #include "ace/Unbounded_Set.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 #include /**/ "tao/TAO_Export.h"
25 #include "tao/Exception.h"
26 #include "tao/params.h"
28 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
31 ACE_END_VERSIONED_NAMESPACE_DECL
33 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
37 class TAO_Acceptor_Filter
;
41 class TAO_Protocol_Factory
;
42 class TAO_Protocol_Item
;
44 typedef ACE_Unbounded_Set_Iterator
<TAO_Protocol_Item
*>
45 TAO_ProtocolFactorySetItor
;
47 typedef TAO_Acceptor
** TAO_AcceptorSetIterator
;
50 * @class TAO_Acceptor_Registry
52 * @brief Acceptor Registry and Generic Acceptor interface definitions.
53 * All loaded ESIOP or GIOP acceptor bridges must register with
56 * This class maintains a list of acceptor factories for all loaded ORB
57 * protocols. There is one Acceptor_Registry per ORB_Core.
59 class TAO_Export TAO_Acceptor_Registry
62 /// Default constructor.
63 TAO_Acceptor_Registry () = default;
65 /// Default destructor.
66 ~TAO_Acceptor_Registry ();
68 /// Initialize all registered acceptors. Return -1 on error.
69 int open (TAO_ORB_Core
*orb_core
,
71 const TAO_EndpointSet
&endpoint_set
,
74 /// Close all open acceptors.
77 /// Returns the total number of endpoints in all of its acceptors.
78 size_t endpoint_count ();
80 /// Check if there is at least one profile in @a mprofile that
81 /// corresponds to a collocated object.
82 bool is_collocated (const TAO_MProfile
& mprofile
);
84 /// Return the acceptor bridges
85 TAO_Acceptor
*get_acceptor (CORBA::ULong tag
);
88 TAO_AcceptorSetIterator
begin ();
89 TAO_AcceptorSetIterator
end ();
92 TAO_Acceptor_Registry (const TAO_Acceptor_Registry
&) = delete;
93 TAO_Acceptor_Registry
&operator= (const TAO_Acceptor_Registry
&) = delete;
95 /// Create a default acceptor for all loaded protocols.
96 int open_default (TAO_ORB_Core
*orb_core
,
100 /// Create a default acceptor using the specified protocol factory.
101 int open_default (TAO_ORB_Core
*orb_core
,
102 ACE_Reactor
*reactor
,
105 TAO_ProtocolFactorySetItor
&factory
,
106 const char *options
);
108 /// Open a default acceptor.
109 int open_default_i (TAO_ORB_Core
*orb_core
,
110 ACE_Reactor
*reactor
,
113 TAO_ProtocolFactorySetItor
&factory
,
114 TAO_Acceptor
* acceptor
,
115 const char *options
);
117 /// Extract endpoint-specific options from the endpoint string.
118 void extract_endpoint_options (ACE_CString
&addrs
,
119 ACE_CString
&options
,
120 TAO_Protocol_Factory
*factory
);
122 /// Extract endpoint/address specific version from the endpoint
124 void extract_endpoint_version (ACE_CString
&address
,
128 /// Iterator through addrs in the string <iop>, and create an
129 /// acceptor for each one.
130 int open_i (TAO_ORB_Core
*orb_core
,
131 ACE_Reactor
*reactor
,
132 ACE_CString
&address
,
133 TAO_ProtocolFactorySetItor
&factory
,
134 bool ignore_address
);
137 /// List of acceptors that are currently open.
138 TAO_Acceptor
**acceptors_
{};
140 /// Number of acceptors that are currently open.
144 TAO_END_VERSIONED_NAMESPACE_DECL
146 #if defined(__ACE_INLINE__)
147 #include "tao/Acceptor_Registry.inl"
148 #endif /* __ACE_INLINE__ */
150 #include /**/ "ace/post.h"
152 #endif /* TAO_ACCEPTOR_REGISTRY_H */