38 const PortableServer::ObjectId& oid,
39 PortableServer::POA_ptr poa
48 if(!oldest || dynamic_cast<ProxyPullSupplier_i*>(*i)->
timestamp()<age)
53 DB(5,
"Evicting oldest ProxyPullSupplier to make space for a new one")
64 PortableServer::POA_ptr parentPoa,
76 DB(20,
"~ProxyPullSupplierManager()")
81 CosEventChannelAdmin::ProxyPullSupplier_ptr
84 return createNarrowedReference<CosEventChannelAdmin::ProxyPullSupplier>(
86 CosEventChannelAdmin::_tc_ProxyPullSupplier->id()
97 CosEventChannelAdmin::ProxyPullSupplier_var ppsv =pps->_this();
111 CosEventComm::PullConsumer_ptr pullConsumer
114 if(_connected || !CORBA::is_nil(_target) || !CORBA::is_nil(_req))
115 throw CosEventChannelAdmin::AlreadyConnected();
118 if(!CORBA::is_nil(pullConsumer))
119 _target=CosEventComm::PullConsumer::_duplicate(pullConsumer);
130 DB(5,
"ProxyPullSupplier_i::disconnect_pull_supplier()");
132 eraseKey(
"ConsumerAdmin/ProxyPullSupplier");
136 throw CORBA::OBJECT_NOT_EXIST(
141 else if(!CORBA::is_nil(_target))
143 CORBA::Request_var req=_target->_request(
"disconnect_pull_consumer");
144 _target=CosEventComm::PullConsumer::_nil();
145 req->send_deferred();
153 throw CosEventComm::Disconnected();
156 return new CORBA::Any(*nextEvent());
158 throw CORBA::TRANSIENT(
167 throw CosEventComm::Disconnected();
172 return new CORBA::Any(*nextEvent());
177 return new CORBA::Any();
184 PortableServer::POA_ptr poa,
189 _target(CosEventComm::PullConsumer::_nil()),
198 DB(20,
"~ProxyPullSupplier_i()")
206 CosEventComm::PullConsumer_var pullConsumer =
207 string_to_<CosEventComm::PullConsumer>(node.
attrString(
"IOR").c_str());
void activate(const char *name)
Creates the Proxy-type's POA, and registers this object as its ServantManager.
void disconnect_pull_supplier()
PortableServer::Servant incarnate(const PortableServer::ObjectId &oid, PortableServer::POA_ptr poa)
Obtains an output stream to the active persistancy logfile, and locks it for exclusive access...
static bool exists()
Library code may create Event Service objects without the need for persistency.
void activateObjectWithId(const char *oidStr)
Calls activate_object_with_id() to activate this servant in its POA.
void disconnect()
Send disconnect_pull_consumer() to all connected PullConsumers.
string attrString(const string &key, const string &fallback="") const
Base class for three of the four Proxy servants.
void output(ostream &os)
Save this object's state to a stream.
#define IFELSE_OMNIORB4(omniORB4_code, default_code)
ProxyPullSupplierManager(const EventChannel_i &channel, PortableServer::POA_ptr parentPoa, EventQueue &q)
~ProxyPullSupplierManager()
CORBA::Any * try_pull(CORBA::Boolean &has_event)
void deactivateObject()
Calls deactivate_object() to deactivate this servant in its POA.
Servant for ProxyPullSupplier interface.
OMNIEVENTS__DEBUG_REF_COUNTS__DECL CosEventChannelAdmin::ProxyPullSupplier_ptr createObject()
void output(ostream &os)
Save this object's state to a stream.
ProxyPullSupplier_i(PortableServer::POA_ptr poa, EventQueue &q)
EventQueue & _queue
Reference to queue shared with ProxyPushSuppliers.
void reincarnate(const string &oid, const PersistNode &node)
Re-create a servant from information saved in the log file.
unsigned long timestamp() const
CosEventComm::PullConsumer_var _target
const EventChannel_i & _channel
void deferredRequest(CORBA::Request_ptr req, Callback *callback=NULL)
Adopts the request and then stores it in _deferredRequests.
void touch()
Update the _timestamp to the current moment.
unsigned long _timestamp
Keep track of when this proxy was last contacted.
CORBA::ULong maxNumProxies() const
#define OMNIEVENTS__DEBUG_REF_COUNTS__DEFN(C)
Defines debug versions of _add/remove_ref() for class C.
void connect_pull_consumer(CosEventComm::PullConsumer_ptr pullConsumer)
The EventQueue is a circular buffer, that contains _size-1 events.
Base class for ServantActivator classes that manage Proxy servants.
Servant for CosEventChannelAdmin::EventChannel objects, also inherits from omni_thread.
PortableServer::POA_var _managedPoa
The POA owned & managed by this object.
void basicOutput(ostream &os, const char *name, CORBA::Object_ptr target=CORBA::Object::_nil(), const char *extraAttributes=NULL)
Helper method for constructing persistency output.
set< Proxy * > _servants
The set of all active Proxies in this object's _managedPoa.