00001 // PushSupplier.cpp,v 1.16 2006/03/15 21:29:09 jtc Exp 00002 00003 #include "orbsvcs/Notify/Any/PushSupplier.h" 00004 00005 ACE_RCSID (Notify, TAO_Notify_PushSupplier, "PushSupplier.cpp,v 1.16 2006/03/15 21:29:09 jtc Exp") 00006 #include "orbsvcs/Notify/Properties.h" 00007 00008 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00009 00010 TAO_Notify_PushSupplier::TAO_Notify_PushSupplier (TAO_Notify_ProxyConsumer* proxy) 00011 :TAO_Notify_Supplier (proxy) 00012 { 00013 } 00014 00015 TAO_Notify_PushSupplier::~TAO_Notify_PushSupplier () 00016 { 00017 } 00018 00019 void 00020 TAO_Notify_PushSupplier::init (CosEventComm::PushSupplier_ptr push_supplier ACE_ENV_ARG_DECL) 00021 { 00022 // TODO: verify single init call 00023 // push_supplier is optional 00024 this->push_supplier_ = CosEventComm::PushSupplier::_duplicate (push_supplier); 00025 00026 ACE_TRY 00027 { 00028 this->subscribe_ = CosNotifyComm::NotifySubscribe::_narrow (push_supplier ACE_ENV_ARG_PARAMETER); 00029 ACE_TRY_CHECK; 00030 } 00031 ACE_CATCHANY 00032 { 00033 // _narrow failed which probably means the interface is CosEventComm type. 00034 } 00035 ACE_ENDTRY; 00036 } 00037 00038 void 00039 TAO_Notify_PushSupplier::release (void) 00040 { 00041 delete this; 00042 //@@ inform factory 00043 } 00044 00045 ACE_CString 00046 TAO_Notify_PushSupplier::get_ior (void) const 00047 { 00048 ACE_CString result; 00049 CORBA::ORB_var orb = TAO_Notify_PROPERTIES::instance()->orb(); 00050 ACE_DECLARE_NEW_CORBA_ENV; 00051 ACE_TRY 00052 { 00053 CORBA::String_var ior = orb->object_to_string(this->push_supplier_.in() ACE_ENV_ARG_PARAMETER); 00054 ACE_TRY_CHECK; 00055 result = static_cast<const char*> (ior.in ()); 00056 } 00057 ACE_CATCHANY 00058 { 00059 result.fast_clear(); 00060 } 00061 ACE_ENDTRY; 00062 return result; 00063 } 00064 00065 TAO_END_VERSIONED_NAMESPACE_DECL