30 namespace OmniEvents {
36 PortableServer::Servant
38 const PortableServer::ObjectId& oid,
39 PortableServer::POA_ptr poa
42 DB(20,
"ProxyPullConsumerManager::incarnate()")
49 PortableServer::POA_ptr parentPoa,
60 DB(20,
"~ProxyPullConsumerManager()")
65 CosEventChannelAdmin::ProxyPullConsumer_ptr
68 return createNarrowedReference<CosEventChannelAdmin::ProxyPullConsumer>(
70 CosEventChannelAdmin::_tc_ProxyPullConsumer->id()
102 CosEventChannelAdmin::ProxyPullConsumer_var ppcv =ppc->_this();
115 CosEventComm::PullSupplier_ptr pullSupplier
118 if(CORBA::is_nil(pullSupplier))
119 throw CORBA::BAD_PARAM();
120 if(!CORBA::is_nil(
_target) || !CORBA::is_nil(
_req))
121 throw CosEventChannelAdmin::AlreadyConnected();
122 _target=CosEventComm::PullSupplier::_duplicate(pullSupplier);
133 DB(5,
"ProxyPullConsumer_i::disconnect_pull_consumer()");
134 eraseKey(
"SupplierAdmin/ProxyPullConsumer");
138 throw CORBA::OBJECT_NOT_EXIST(
145 CORBA::Request_var req=
_target->_request(
"disconnect_pull_supplier");
146 _target=CosEventComm::PullSupplier::_nil();
147 req->send_deferred();
155 PortableServer::POA_ptr poa,
159 _target(CosEventComm::PullSupplier::_nil()),
167 DB(20,
"~ProxyPullConsumer_i()")
172 if(!CORBA::is_nil(
_req) &&
_req->poll_response())
174 const char* opname =
_req->operation();
176 CORBA::Environment_ptr env =
_req->env();
178 if(!CORBA::is_nil(env) && env->exception())
180 CORBA::Exception* ex =env->exception();
181 DB(10,
"ProxyPullConsumer got exception"
182 IF_OMNIORB4(<<
": "<<ex->_name())<<
", op:"<<opname);
183 if(0==strcmp(
"pull",opname) || 0==strcmp(
"try_pull",opname))
189 DB(2,
"Ignoring unrecognised response. operation:"<<opname);
195 CORBA::Request_var req=
_target->_request(
"disconnect_pull_supplier");
196 req->send_deferred();
199 _target=CosEventComm::PullSupplier::_nil();
200 eraseKey(
"SupplierAdmin/ProxyPullConsumer");
208 if(0==strcmp(
"pull",opname))
212 else if(0==strcmp(
"try_pull",opname))
214 CORBA::NVList_ptr args=
_req->arguments();
217 CORBA::NamedValue_var hasEventArg=args->item(0);
218 if(0==strcmp(hasEventArg->name(),
"has_event"))
220 CORBA::Any* a =hasEventArg->value();
222 CORBA::Any::to_boolean tb(b);
223 hasEvent=(((*a)>>=tb) && b);
230 CORBA::Any*
event =
new CORBA::Any();
231 _req->return_value() >>= (*event);
237 _req=CORBA::Request::_nil();
252 _req->add_out_arg(
"has_event")<<=CORBA::Any::from_boolean(1);
257 _req->set_return_type(CORBA::_tc_any);
258 _req->send_deferred();
267 CosEventComm::PullSupplier_var pullSupplier =
268 string_to_<CosEventComm::PullSupplier>(node.
attrString(
"IOR").c_str());