#include <ESF_Proxy_Admin.h>
Inheritance diagram for TAO_ESF_Proxy_Admin< EVENT_CHANNEL, PROXY, INTERFACE >:
Public Member Functions | |
TAO_ESF_Proxy_Admin (EVENT_CHANNEL *ec) | |
Constructor, allocate the internal collection. | |
virtual | ~TAO_ESF_Proxy_Admin (void) |
Cleanup internal resources, destroy the internal collection. | |
void | for_each (TAO_ESF_Worker< PROXY > *worker) |
Iterate over its internal collection. | |
virtual INTERFACE * | obtain (void) |
Create a new PROXY and activate it. | |
virtual void | shutdown (void) |
virtual void | connected (PROXY *proxy) |
virtual void | reconnected (PROXY *proxy) |
virtual void | disconnected (PROXY *proxy) |
Protected Attributes | |
EVENT_CHANNEL * | event_channel_ |
The Event Channel we belong to. | |
Private Types | |
typedef TAO_ESF_Proxy_Collection< PROXY > | Collection |
Shorthand for the Proxy collection. | |
Private Attributes | |
Collection * | collection_ |
The proxy collection object. |
The EVENT_CHANNEL interface must implement:
* /// create a new proxy * void create_proxy (PROXY*&); * * /// destroy a proxy * void destroy_proxy (PROXY*); * * /// create a proxy collection * void create_proxy_collection (TAO_ESF_Proxy_Collection<PROXY>*&); * * /// destroy a proxy collection * void destroy_proxy_collection (TAO_ESF_Proxy_Collection<PROXY>*&); *
In addition to the requirements imposed by TAO_ESF_Proxy_Collection<>, the PROXY interface must define:
* /// The T_ptr for the IDL interface implemented by the PROXY. * typename .... _ptr_type; * * /// The T_var for the IDL interface implemented by the PROXY. * typename .... _var_type; * * /// activate the proxy and return the object reference * PROXY::_ptr_type * PROXY::activate (void) throw (); *
Definition at line 65 of file ESF_Proxy_Admin.h.
|
Shorthand for the Proxy collection.
Definition at line 121 of file ESF_Proxy_Admin.h. |
|
Constructor, allocate the internal collection.
Definition at line 16 of file ESF_Proxy_Admin.cpp. References TAO_ESF_Proxy_Admin< EVENT_CHANNEL, PROXY, INTERFACE >::event_channel_.
00017 : event_channel_ (ec) 00018 { 00019 this->event_channel_->create_proxy_collection (this->collection_); 00020 } |
|
Cleanup internal resources, destroy the internal collection.
Definition at line 24 of file ESF_Proxy_Admin.cpp. References TAO_ESF_Proxy_Admin< EVENT_CHANNEL, PROXY, INTERFACE >::event_channel_.
00025 { 00026 this->event_channel_->destroy_proxy_collection (this->collection_); 00027 } |
|
A has connected, this is invoked when the proxy's client has invoked the connect_xxx_yyy() method. The default implementation is a no-op. Definition at line 61 of file ESF_Proxy_Admin.cpp.
00062 { 00063 } |
|
A has been disconnected. The default implementation removes the object from the collection and deactivates the proxy. Definition at line 74 of file ESF_Proxy_Admin.cpp.
00075 { 00076 proxy->deactivate (); 00077 // Cannot happen, just following the discipline. 00078 00079 try 00080 { 00081 this->collection_->disconnected (proxy); 00082 } 00083 catch (const CORBA::Exception&) 00084 { 00085 // @@ In the future the collections may raise exceptions to 00086 // report errors (such as out of memory or things like that). 00087 // We must decide how is that info going to be used, and how 00088 // would we propagate the exception to the application. 00089 // For example: the CosEC has no exceptions for "out of 00090 // resources" or something similar, and i've never seen a spec 00091 // that has an exception for "could not acquire a mutex". 00092 } 00093 } |
|
Iterate over its internal collection.
Definition at line 9 of file ESF_Proxy_Admin.inl. Referenced by TAO_ESF_Peer_Admin< EVENT_CHANNEL, PROXY, INTERFACE, PEER >::peer_connected(), TAO_ESF_Peer_Admin< EVENT_CHANNEL, PROXY, INTERFACE, PEER >::peer_disconnected(), and TAO_ESF_Peer_Admin< EVENT_CHANNEL, PROXY, INTERFACE, PEER >::peer_reconnected().
00010 { 00011 this->collection_->for_each (worker); 00012 } |
|
Create a new PROXY and activate it.
Definition at line 31 of file ESF_Proxy_Admin.cpp. References TAO_ESF_Proxy_Admin< EVENT_CHANNEL, PROXY, INTERFACE >::event_channel_.
00032 { 00033 PROXY* proxy; 00034 this->event_channel_->create_proxy (proxy); 00035 00036 TAO_ESF_RefCountedRef<PROXY> holder (proxy); 00037 00038 typename PROXY::_ptr_type r; 00039 proxy->activate (r); 00040 00041 typename PROXY::_var_type result = r; 00042 00043 this->collection_->connected (proxy); 00044 00045 return result._retn (); 00046 } |
|
A has reconnected, i.e. its client has invoked the connect_xxx_yyy() method, but the proxy was connected already. The default implementation delegates on the collection method Definition at line 67 of file ESF_Proxy_Admin.cpp.
00068 { 00069 this->collection_->reconnected (proxy); 00070 } |
|
The Event Channel that owns this Admin object is going down. Invoke on all the proxies, cleanup the collection and prepare to terminate. Definition at line 49 of file ESF_Proxy_Admin.cpp.
00050 { 00051 TAO_ESF_Shutdown_Proxy<PROXY> worker; 00052 00053 this->collection_->for_each (&worker); 00054 // Cannot happen, just following the discipline. 00055 00056 this->collection_->shutdown (); 00057 } |
|
The proxy collection object.
Definition at line 124 of file ESF_Proxy_Admin.h. |
|
The Event Channel we belong to.
Definition at line 117 of file ESF_Proxy_Admin.h. Referenced by TAO_ESF_Proxy_Admin< EVENT_CHANNEL, PROXY, INTERFACE >::obtain(), TAO_ESF_Proxy_Admin< EVENT_CHANNEL, PROXY, INTERFACE >::TAO_ESF_Proxy_Admin(), and TAO_ESF_Proxy_Admin< EVENT_CHANNEL, PROXY, INTERFACE >::~TAO_ESF_Proxy_Admin(). |