Implement common tasks in the Admin interfaces. More...
#include <ESF_Proxy_Admin.h>
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. |
Implement common tasks in the Admin interfaces.
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.
typedef TAO_ESF_Proxy_Collection<PROXY> TAO_ESF_Proxy_Admin< EVENT_CHANNEL, PROXY, INTERFACE >::Collection [private] |
Shorthand for the Proxy collection.
Definition at line 121 of file ESF_Proxy_Admin.h.
TAO_ESF_Proxy_Admin< EVENT_CHANNEL, PROXY, INTERFACE >::TAO_ESF_Proxy_Admin | ( | EVENT_CHANNEL * | ec | ) |
Constructor, allocate the internal collection.
Definition at line 16 of file ESF_Proxy_Admin.cpp.
: event_channel_ (ec) { this->event_channel_->create_proxy_collection (this->collection_); }
TAO_ESF_Proxy_Admin< EVENT_CHANNEL, PROXY, INTERFACE >::~TAO_ESF_Proxy_Admin | ( | void | ) | [virtual] |
Cleanup internal resources, destroy the internal collection.
Definition at line 24 of file ESF_Proxy_Admin.cpp.
{ this->event_channel_->destroy_proxy_collection (this->collection_); }
void TAO_ESF_Proxy_Admin< EVENT_CHANNEL, PROXY, INTERFACE >::connected | ( | PROXY * | proxy | ) | [virtual] |
A <proxy> 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.
{ }
void TAO_ESF_Proxy_Admin< EVENT_CHANNEL, PROXY, INTERFACE >::disconnected | ( | PROXY * | proxy | ) | [virtual] |
A <proxy> 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.
{ proxy->deactivate (); // Cannot happen, just following the discipline. try { this->collection_->disconnected (proxy); } catch (const CORBA::Exception&) { // @@ In the future the collections may raise exceptions to // report errors (such as out of memory or things like that). // We must decide how is that info going to be used, and how // would we propagate the exception to the application. // For example: the CosEC has no exceptions for "out of // resources" or something similar, and i've never seen a spec // that has an exception for "could not acquire a mutex". } }
void TAO_ESF_Proxy_Admin< EVENT_CHANNEL, PROXY, INTERFACE >::for_each | ( | TAO_ESF_Worker< PROXY > * | worker | ) |
Iterate over its internal collection.
INTERFACE * TAO_ESF_Proxy_Admin< EVENT_CHANNEL, PROXY, INTERFACE >::obtain | ( | void | ) | [virtual] |
Create a new PROXY and activate it.
Definition at line 31 of file ESF_Proxy_Admin.cpp.
{ PROXY* proxy; this->event_channel_->create_proxy (proxy); TAO_ESF_RefCountedRef<PROXY> holder (proxy); typename PROXY::_ptr_type r; proxy->activate (r); typename PROXY::_var_type result = r; this->collection_->connected (proxy); return result._retn (); }
void TAO_ESF_Proxy_Admin< EVENT_CHANNEL, PROXY, INTERFACE >::reconnected | ( | PROXY * | proxy | ) | [virtual] |
A <proxy> 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 <reconnected> method
Definition at line 67 of file ESF_Proxy_Admin.cpp.
{ this->collection_->reconnected (proxy); }
void TAO_ESF_Proxy_Admin< EVENT_CHANNEL, PROXY, INTERFACE >::shutdown | ( | void | ) | [virtual] |
The Event Channel that owns this Admin object is going down. Invoke <shutdown> on all the proxies, cleanup the collection and prepare to terminate.
Definition at line 49 of file ESF_Proxy_Admin.cpp.
{ TAO_ESF_Shutdown_Proxy<PROXY> worker; this->collection_->for_each (&worker); // Cannot happen, just following the discipline. this->collection_->shutdown (); }
Collection* TAO_ESF_Proxy_Admin< EVENT_CHANNEL, PROXY, INTERFACE >::collection_ [private] |
The proxy collection object.
Definition at line 124 of file ESF_Proxy_Admin.h.
EVENT_CHANNEL* TAO_ESF_Proxy_Admin< EVENT_CHANNEL, PROXY, INTERFACE >::event_channel_ [protected] |
The Event Channel we belong to.
Definition at line 117 of file ESF_Proxy_Admin.h.