00001 // CosEC_ProxyPushConsumer.cpp,v 1.13 2006/03/15 21:29:09 jtc Exp 00002 00003 #include "orbsvcs/Notify/Any/CosEC_ProxyPushConsumer.h" 00004 00005 ACE_RCSID (Notify, TAO_Notify_CosEC_ProxyPushConsumer, "CosEC_ProxyPushConsumer.cpp,v 1.13 2006/03/15 21:29:09 jtc Exp") 00006 00007 #include "tao/debug.h" 00008 #include "orbsvcs/Notify/AdminProperties.h" 00009 #include "orbsvcs/Notify/Method_Request_Lookup.h" 00010 #include "orbsvcs/Notify/Worker_Task.h" 00011 #include "orbsvcs/Notify/Any/AnyEvent.h" 00012 #include "orbsvcs/Notify/Any/PushSupplier.h" 00013 00014 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00015 00016 TAO_Notify_CosEC_ProxyPushConsumer::TAO_Notify_CosEC_ProxyPushConsumer (void) 00017 { 00018 } 00019 00020 TAO_Notify_CosEC_ProxyPushConsumer::~TAO_Notify_CosEC_ProxyPushConsumer () 00021 { 00022 } 00023 00024 void 00025 TAO_Notify_CosEC_ProxyPushConsumer::release (void) 00026 { 00027 delete this; 00028 //@@ inform factory 00029 } 00030 00031 void 00032 TAO_Notify_CosEC_ProxyPushConsumer::push (const CORBA::Any& any ACE_ENV_ARG_DECL) 00033 ACE_THROW_SPEC (( 00034 CORBA::SystemException 00035 , CosEventComm::Disconnected 00036 )) 00037 { 00038 // Check if we should proceed at all. 00039 if (this->admin_properties().reject_new_events () == 1 00040 && this->admin_properties().queue_full ()) 00041 ACE_THROW (CORBA::IMP_LIMIT ()); 00042 00043 if (this->is_connected () == 0) 00044 { 00045 ACE_THROW (CosEventComm::Disconnected ()); 00046 } 00047 00048 TAO_Notify_AnyEvent_No_Copy event (any); 00049 00050 TAO_Notify_Method_Request_Lookup_No_Copy request (&event, this); 00051 00052 this->execute_task (request ACE_ENV_ARG_PARAMETER); 00053 } 00054 00055 void 00056 TAO_Notify_CosEC_ProxyPushConsumer::connect_push_supplier (CosEventComm::PushSupplier_ptr push_supplier ACE_ENV_ARG_DECL) 00057 ACE_THROW_SPEC (( 00058 CORBA::SystemException 00059 , CosEventChannelAdmin::AlreadyConnected 00060 )) 00061 { 00062 // Convert Supplier to Base Type 00063 TAO_Notify_PushSupplier *supplier; 00064 ACE_NEW_THROW_EX (supplier, 00065 TAO_Notify_PushSupplier (this), 00066 CORBA::NO_MEMORY ()); 00067 00068 supplier->init (push_supplier ACE_ENV_ARG_PARAMETER); 00069 ACE_CHECK; 00070 00071 this->connect (supplier ACE_ENV_ARG_PARAMETER); 00072 } 00073 00074 void 00075 TAO_Notify_CosEC_ProxyPushConsumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL) 00076 ACE_THROW_SPEC (( 00077 CORBA::SystemException 00078 )) 00079 { 00080 TAO_Notify_CosEC_ProxyPushConsumer::Ptr guard( this ); 00081 this->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); 00082 } 00083 00084 const char * 00085 TAO_Notify_CosEC_ProxyPushConsumer::get_proxy_type_name (void) const 00086 { 00087 return "ec_proxy_push_consumer"; 00088 } 00089 00090 TAO_END_VERSIONED_NAMESPACE_DECL