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());
ProxyPullSupplier_i(PortableServer::POA_ptr poa, EventQueue &q)
PortableServer::Servant incarnate(const PortableServer::ObjectId &oid, PortableServer::POA_ptr poa)
Base class for three of the four Proxy servants.
PortableServer::POA_var _managedPoa
The POA owned & managed by this object.
The EventQueue is a circular buffer, that contains _size-1 events.
const EventChannel_i & _channel
void activate(const char *name)
Creates the Proxy-type's POA, and registers this object as its ServantManager.
void connect_pull_consumer(CosEventComm::PullConsumer_ptr pullConsumer)
unsigned long timestamp() const
void touch()
Update the _timestamp to the current moment.
Base class for ServantActivator classes that manage Proxy servants.
string attrString(const string &key, const string &fallback="") const
void disconnect()
Send disconnect_pull_consumer() to all connected PullConsumers.
void deferredRequest(CORBA::Request_ptr req, Callback *callback=NULL)
Adopts the request and then stores it in _deferredRequests.
void deactivateObject()
Calls deactivate_object() to deactivate this servant in its POA.
CORBA::ULong maxNumProxies() const
void basicOutput(ostream &os, const char *name, CORBA::Object_ptr target=CORBA::Object::_nil(), const char *extraAttributes=NULL)
Helper method for constructing persistency output.
CosEventComm::PullConsumer_var _target
static bool exists()
Library code may create Event Service objects without the need for persistency.
void disconnect_pull_supplier()
Servant for ProxyPullSupplier interface.
void output(ostream &os)
Save this object's state to a stream.
void activateObjectWithId(const char *oidStr)
Calls activate_object_with_id() to activate this servant in its POA.
CORBA::Any * try_pull(CORBA::Boolean &has_event)
set< Proxy * > _servants
The set of all active Proxies in this object's _managedPoa.
void reincarnate(const string &oid, const PersistNode &node)
Re-create a servant from information saved in the log file.
#define OMNIEVENTS__DEBUG_REF_COUNTS__DEFN(C)
Defines debug versions of _add/remove_ref() for class C.
unsigned long _timestamp
Keep track of when this proxy was last contacted.
Obtains an output stream to the active persistancy logfile, and locks it for exclusive access...
ProxyPullSupplierManager(const EventChannel_i &channel, PortableServer::POA_ptr parentPoa, EventQueue &q)
#define IFELSE_OMNIORB4(omniORB4_code, default_code)
~ProxyPullSupplierManager()
void output(ostream &os)
Save this object's state to a stream.
OMNIEVENTS__DEBUG_REF_COUNTS__DECL CosEventChannelAdmin::ProxyPullSupplier_ptr createObject()
EventQueue & _queue
Reference to queue shared with ProxyPushSuppliers.
Servant for CosEventChannelAdmin::EventChannel objects, also inherits from omni_thread.