00001 // $Id: PushSupplier.cpp 84685 2009-03-02 22:49:17Z mesnier_p $ 00002 00003 #include "orbsvcs/Notify/Any/PushSupplier.h" 00004 00005 ACE_RCSID (Notify, TAO_Notify_PushSupplier, "$Id: PushSupplier.cpp 84685 2009-03-02 22:49:17Z mesnier_p $") 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) 00021 { 00022 // TODO: verify single init call 00023 // push_supplier is optional 00024 this->push_supplier_ = CosEventComm::PushSupplier::_duplicate (push_supplier); 00025 00026 try 00027 { 00028 this->subscribe_ = CosNotifyComm::NotifySubscribe::_narrow (push_supplier); 00029 } 00030 catch (const CORBA::Exception&) 00031 { 00032 // _narrow failed which probably means the interface is CosEventComm type. 00033 } 00034 } 00035 00036 void 00037 TAO_Notify_PushSupplier::release (void) 00038 { 00039 delete this; 00040 //@@ inform factory 00041 } 00042 00043 ACE_CString 00044 TAO_Notify_PushSupplier::get_ior (void) const 00045 { 00046 ACE_CString result; 00047 CORBA::ORB_var orb = TAO_Notify_PROPERTIES::instance()->orb(); 00048 try 00049 { 00050 CORBA::String_var ior = orb->object_to_string(this->push_supplier_.in()); 00051 result = static_cast<const char*> (ior.in ()); 00052 } 00053 catch (const CORBA::Exception&) 00054 { 00055 result.fast_clear(); 00056 } 00057 return result; 00058 } 00059 00060 CORBA::Object_ptr 00061 TAO_Notify_PushSupplier::get_supplier (void) 00062 { 00063 return CosEventComm::PushSupplier::_duplicate (this->push_supplier_.in ()); 00064 } 00065 00066 TAO_END_VERSIONED_NAMESPACE_DECL