00001 // $Id: CosEC_ProxyPushSupplier.cpp 87253 2009-10-28 23:29:32Z dai_y $ 00002 00003 #include "orbsvcs/Notify/Any/CosEC_ProxyPushSupplier.h" 00004 00005 ACE_RCSID (Notify, TAO_Notify_CosEC_ProxyPushSupplier, "$Id: CosEC_ProxyPushSupplier.cpp 87253 2009-10-28 23:29:32Z dai_y $") 00006 00007 #include "tao/debug.h" 00008 #include "orbsvcs/Notify/Any/PushConsumer.h" 00009 00010 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00011 00012 TAO_Notify_CosEC_ProxyPushSupplier::TAO_Notify_CosEC_ProxyPushSupplier (void) 00013 { 00014 } 00015 00016 TAO_Notify_CosEC_ProxyPushSupplier::~TAO_Notify_CosEC_ProxyPushSupplier () 00017 { 00018 } 00019 00020 void 00021 TAO_Notify_CosEC_ProxyPushSupplier::release (void) 00022 { 00023 00024 delete this; 00025 //@@ inform factory 00026 } 00027 00028 void 00029 TAO_Notify_CosEC_ProxyPushSupplier::connect_push_consumer (CosEventComm::PushConsumer_ptr push_consumer) 00030 { 00031 // Convert Consumer to Base Type 00032 TAO_Notify_PushConsumer* consumer; 00033 ACE_NEW_THROW_EX (consumer, 00034 TAO_Notify_PushConsumer (this), 00035 CORBA::NO_MEMORY ()); 00036 00037 consumer->init (push_consumer); 00038 00039 this->connect (consumer); 00040 } 00041 00042 void 00043 TAO_Notify_CosEC_ProxyPushSupplier::disconnect_push_supplier (void) 00044 { 00045 TAO_Notify_CosEC_ProxyPushSupplier::Ptr guard( this ); 00046 this->destroy (); 00047 } 00048 00049 const char * 00050 TAO_Notify_CosEC_ProxyPushSupplier::get_proxy_type_name (void) const 00051 { 00052 return "ec_proxy_push_supplier"; 00053 } 00054 00055 void 00056 TAO_Notify_CosEC_ProxyPushSupplier::validate () 00057 { 00058 TAO_Notify_Consumer* con = this->consumer (); 00059 if (con != 0 && ! con->is_alive (true)) 00060 { 00061 if (TAO_debug_level > 0) 00062 { 00063 ACE_DEBUG ((LM_DEBUG, 00064 ACE_TEXT ("(%P|%t) TAO_Notify_CosEC_ProxyPushSupplier::validate(%d)") 00065 ACE_TEXT ("disconnecting \n"), this->id ())); 00066 } 00067 this->disconnect_push_supplier (); 00068 } 00069 } 00070 00071 void 00072 TAO_Notify_CosEC_ProxyPushSupplier::configure( 00073 TAO_Notify_ConsumerAdmin & /*admin*/, 00074 CosNotifyChannelAdmin::ProxyID_out /*proxy_id*/) 00075 { 00076 // Nothing to do. 00077 // This virtual method was added to support Notification MC 00078 } 00079 00080 TAO_END_VERSIONED_NAMESPACE_DECL