Go to the documentation of this file.00001
00002
00003 #ifndef TAO_ESF_PROXY_ADMIN_CPP
00004 #define TAO_ESF_PROXY_ADMIN_CPP
00005
00006 #if ! defined (__ACE_INLINE__)
00007 #include "orbsvcs/ESF/ESF_Proxy_Admin.inl"
00008 #endif
00009
00010 #include "orbsvcs/ESF/ESF_Shutdown_Proxy.h"
00011
00012 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00013
00014 template<class EVENT_CHANNEL, class PROXY, class INTERFACE>
00015 TAO_ESF_Proxy_Admin<EVENT_CHANNEL,PROXY,INTERFACE>::
00016 TAO_ESF_Proxy_Admin (EVENT_CHANNEL *ec)
00017 : event_channel_ (ec)
00018 {
00019 this->event_channel_->create_proxy_collection (this->collection_);
00020 }
00021
00022 template<class EVENT_CHANNEL, class PROXY, class INTERFACE>
00023 TAO_ESF_Proxy_Admin<EVENT_CHANNEL,PROXY,INTERFACE>::
00024 ~TAO_ESF_Proxy_Admin (void)
00025 {
00026 this->event_channel_->destroy_proxy_collection (this->collection_);
00027 }
00028
00029 template<class EVENT_CHANNEL, class PROXY, class INTERFACE> INTERFACE*
00030 TAO_ESF_Proxy_Admin<EVENT_CHANNEL,PROXY,INTERFACE>::
00031 obtain (void)
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 }
00047
00048 template<class EVENT_CHANNEL, class PROXY, class INTERFACE> void
00049 TAO_ESF_Proxy_Admin<EVENT_CHANNEL,PROXY,INTERFACE>::shutdown (void)
00050 {
00051 TAO_ESF_Shutdown_Proxy<PROXY> worker;
00052
00053 this->collection_->for_each (&worker);
00054
00055
00056 this->collection_->shutdown ();
00057 }
00058
00059 template<class EVENT_CHANNEL, class PROXY, class INTERFACE> void
00060 TAO_ESF_Proxy_Admin<EVENT_CHANNEL,PROXY,INTERFACE>::
00061 connected (PROXY *)
00062 {
00063 }
00064
00065 template<class EVENT_CHANNEL, class PROXY, class INTERFACE> void
00066 TAO_ESF_Proxy_Admin<EVENT_CHANNEL,PROXY,INTERFACE>::
00067 reconnected (PROXY *proxy)
00068 {
00069 this->collection_->reconnected (proxy);
00070 }
00071
00072 template<class EVENT_CHANNEL, class PROXY, class INTERFACE> void
00073 TAO_ESF_Proxy_Admin<EVENT_CHANNEL,PROXY,INTERFACE>::
00074 disconnected (PROXY *proxy)
00075 {
00076 proxy->deactivate ();
00077
00078
00079 try
00080 {
00081 this->collection_->disconnected (proxy);
00082 }
00083 catch (const CORBA::Exception&)
00084 {
00085
00086
00087
00088
00089
00090
00091
00092 }
00093 }
00094
00095 TAO_END_VERSIONED_NAMESPACE_DECL
00096
00097 #endif