ESF_Proxy_Admin.cpp

Go to the documentation of this file.
00001 // $Id: ESF_Proxy_Admin.cpp 78820 2007-07-07 20:06:46Z sowayaa $
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 /* __ACE_INLINE__ */
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 // Cannot happen, just following the discipline.
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 // 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 }
00094 
00095 TAO_END_VERSIONED_NAMESPACE_DECL
00096 
00097 #endif /* TAO_ESF_PROXY_ADMIN_CPP */

Generated on Sun Jan 27 13:38:38 2008 for TAO_ESF by doxygen 1.3.6