org.jacorb.events
Class ProxyPullConsumerImpl

java.lang.Object
  extended byorg.omg.PortableServer.Servant
      extended byorg.omg.CosEventChannelAdmin.ProxyPullConsumerPOA
          extended byorg.jacorb.events.ProxyPullConsumerImpl
All Implemented Interfaces:
InvokeHandler, ProxyPullConsumerOperations, PullConsumerOperations, java.lang.Runnable

public class ProxyPullConsumerImpl
extends ProxyPullConsumerPOA
implements java.lang.Runnable

Implementation of COSEventChannelAdmin interface; ProxyPullConsumer. This defines connect_pull_supplier() and disconnect_pull_consumer(). 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, Joerg v. Frantzius, Rainer Lischetzki, Gerald Brose $Id: ProxyPullConsumerImpl.java,v 1.9 2003/10/29 12:00:29 simon.mcqueen Exp $

Constructor Summary
protected ProxyPullConsumerImpl(EventChannelImpl ec, ORB orb, POA poa)
          Constructor - gets called by the EventChannel
 
Method Summary
 POA _default_POA()
          Override this method from the Servant baseclass.
 void connect_pull_supplier(PullSupplier pullSupplier)
          ProxyPullConsumer Interface: As stated by the EventService specification 1.1 section 2.3.6: "If a ProxyPullSupplier is already connected to a PullConsumer, then the AlreadyConnected exception is raised."
 void disconnect_pull_consumer()
          See EventService v 1.1 specification section 2.1.4.
 void run()
          Start being a good PullConsumer and ask for loads of events.
 
Methods inherited from class org.omg.CosEventChannelAdmin.ProxyPullConsumerPOA
_all_interfaces, _invoke, _this, _this
 
Methods inherited from class org.omg.PortableServer.Servant
_get_delegate, _get_interface_def, _get_interface, _is_a, _non_existent, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyPullConsumerImpl

protected ProxyPullConsumerImpl(EventChannelImpl ec,
                                ORB orb,
                                POA poa)
Constructor - gets called by the EventChannel

Method Detail

connect_pull_supplier

public void connect_pull_supplier(PullSupplier pullSupplier)
                           throws AlreadyConnected,
                                  TypeError
ProxyPullConsumer Interface: As stated by the EventService specification 1.1 section 2.3.6: "If a ProxyPullSupplier is already connected to a PullConsumer, then the AlreadyConnected exception is raised." and "Implementations shall raise the CORBA standard BAD_PARAM exception if a nil object reference is passed to the connect_pull_supplier operation. and "An implementation of a ProxyPullConsumer may put additional requirements on the interface supported by the pull supplier. If t he pull supplier does not meet those requirements, the ProxyPullConsumer raises the TypeError exception. (See section 2.5.2 on page 2-15 for an example)"

Specified by:
connect_pull_supplier in interface ProxyPullConsumerOperations
Throws:
AlreadyConnected
TypeError

disconnect_pull_consumer

public void disconnect_pull_consumer()
See EventService v 1.1 specification section 2.1.4. 'disconnect_pull_consumer terminates the event communication; it releases resources used at the consumer to support event communication. Calling this causes the implementation to call disconnect_pull_supplier operation on the corresponding PullSupplier 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.

Specified by:
disconnect_pull_consumer in interface PullConsumerOperations

run

public void run()
Start being a good PullConsumer and ask for loads of events.

Specified by:
run in interface java.lang.Runnable

_default_POA

public POA _default_POA()
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.

Overrides:
_default_POA in class Servant