| org.jacorb.events.ProxyPullSupplierImpl
ProxyPullSupplierImpl | public class ProxyPullSupplierImpl extends org.omg.CosEventChannelAdmin.ProxyPullSupplierPOA (Code) | | Implementation of COSEventChannelAdmin interface; ProxyPullSupplier.
This defines connect_pull_consumer(), disconnect_pull_supplier() and the all
important pull() and try_pull() methods that the Consumer can call to
actuall deliver a message.
2002/23/08 JFC OMG EventService Specification 1.1 page 2-7 states:
"Registration is a two step process. An event-generating application
first obtains a proxy consumer from a channel, then 'connects' to the
proxy consumer by providing it with a supplier. ... The reason for
the two step registration process..."
Modifications to support the above have been made as well as to support
section 2.1.5 "Disconnection Behavior" on page 2-4.
author: Jeff Carlson author: Joerg v. Frantzius author: Rainer Lischetzki author: Gerald Brose version: $Id: ProxyPullSupplierImpl.java,v 1.11 2004/05/06 12:39:58 nicolas Exp $ |
Method Summary | |
public org.omg.PortableServer.POA | _default_POA() Override this method from the Servant baseclass. | public void | connect_pull_consumer(PullConsumer pullConsumer) ProxyPullSupplier Interface:
As stated by the EventService specification 1.1 section 2.3.5:
"If a ProxyPullSupplier is already connected to a PullConsumer, then the
AlreadyConnected exception is raised."
and
"If a non-nil reference is passed to connect_push_supplier..." implying
that a null reference is acceptable. | public void | disconnect_pull_supplier() See EventService v 1.1 specification section 2.1.3.
'disconnect_pull_supplier terminates the event communication; it releases
resources used at the consumer to support event communication. | public org.omg.CORBA.Any | pull() PullSupplier Interface.
section 2.1.3 states that "The pull operation blocks until the
event data is available or an exception is raised. | public void | push_to_supplier(org.omg.CORBA.Any event) Have to be able to get to the internal list of events. | public org.omg.CORBA.Any | try_pull(org.omg.CORBA.BooleanHolder hasEvent) PullSupplier Interface.
section 2.1.3 states that "The try_pull operation does not block:
if the event data is available, it returns the event data and sets the
has_event parameter to true; if the event is not available, it
sets the has_event parameter to false and the event data is
returned as long with an undefined value.
It seems that the event queue should be defined as a LIFO queue. |
_default_POA | public org.omg.PortableServer.POA _default_POA()(Code) | | Override this method from the Servant baseclass. Fintan Bolton
in his book "Pure CORBA" suggests that you override this method to
avoid the risk that a servant object (like this one) could be
activated by the wrong POA object.
|
connect_pull_consumer | public void connect_pull_consumer(PullConsumer pullConsumer) throws org.omg.CosEventChannelAdmin.AlreadyConnected(Code) | | ProxyPullSupplier Interface:
As stated by the EventService specification 1.1 section 2.3.5:
"If a ProxyPullSupplier is already connected to a PullConsumer, then the
AlreadyConnected exception is raised."
and
"If a non-nil reference is passed to connect_push_supplier..." implying
that a null reference is acceptable.
|
disconnect_pull_supplier | public void disconnect_pull_supplier()(Code) | | See EventService v 1.1 specification section 2.1.3.
'disconnect_pull_supplier terminates the event communication; it releases
resources used at the consumer to support event communication. Calling
this causes the implementation to call disconnect_pull_consumer operation
on the corresponding PullConsumer interface (if that iterface is known).'
See EventService v 1.1 specification section 2.1.5. This method should
adhere to the spec as it a) causes a call to the corresponding disconnect
on the connected supplier, b) 'If a consumer or supplier has received a
disconnect call and subsequently receives another disconnect call, it
shall raise a CORBA::OBJECT_NOT_EXIST exception.
See EventService v 1.1 specification section 2.3.5. If [a nil object
reference is passed to connect_pull_consumer] a channel cannot invoke a
disconnect_pull_consumer operation on the consumer.
|
pull | public org.omg.CORBA.Any pull() throws org.omg.CosEventComm.Disconnected(Code) | | PullSupplier Interface.
section 2.1.3 states that "The pull operation blocks until the
event data is available or an exception is raised. It returns data to
the consumer."
|
push_to_supplier | public void push_to_supplier(org.omg.CORBA.Any event)(Code) | | Have to be able to get to the internal list of events. This is how
to add stuff to this list.
I have to decide whether to a) just ignore the event, b) add the event
to the queue and remove the oldest event, c) throw an runtime exception.
Right now, I'm going with option b.
|
try_pull | public org.omg.CORBA.Any try_pull(org.omg.CORBA.BooleanHolder hasEvent) throws org.omg.CosEventComm.Disconnected(Code) | | PullSupplier Interface.
section 2.1.3 states that "The try_pull operation does not block:
if the event data is available, it returns the event data and sets the
has_event parameter to true; if the event is not available, it
sets the has_event parameter to false and the event data is
returned as long with an undefined value.
It seems that the event queue should be defined as a LIFO queue. Finton
Bolton in his book Pure CORBA states that this is the "norm". I think
that is really stupid. Who wants events in reverse order with a
possibility of never getting the first messge? I will therefore implement
this as a FIFO queue and wait for someone to convince me otherwise.
|
|
|