org.jacorb.orb.etf
Class ListenerBase

java.lang.Object
  extended byorg.omg.CORBA.LocalObject
      extended byorg.omg.ETF._ListenerLocalBase
          extended byorg.jacorb.orb.etf.ListenerBase
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable, IDLEntity, Listener, ListenerOperations, LocalInterface, Object, java.io.Serializable
Direct Known Subclasses:
IIOPListener

public abstract class ListenerBase
extends _ListenerLocalBase
implements org.apache.avalon.framework.configuration.Configurable

Version:
$Id: ListenerBase.java,v 1.2 2005/09/27 20:49:11 phil.mesnier Exp $
Author:
Andre Spiegel
See Also:
Serialized Form

Nested Class Summary
protected  class ListenerBase.Acceptor
           
 
Field Summary
protected  ListenerBase.Acceptor acceptor
          The primary acceptor of this listener.
protected  org.jacorb.config.Configuration configuration
          The configuration.
protected  java.util.List incoming_connections
          Queue of incoming connections, which will be delivered via calls to the accept() method.
protected  org.apache.avalon.framework.logger.Logger logger
          The logger.
protected  ORB orb
          The ORB.
protected  Profile profile
          The profile of this listener's endpoint.
protected  boolean terminated
           
protected  Handle up
          Reference to the ORB, for delivering incoming connections via upcalls.
 
Constructor Summary
ListenerBase()
           
ListenerBase(ORB orb)
          Deprecated.  
 
Method Summary
 Connection accept()
          This call is an alternative to using set_handle() to initiate the callback-style of accepting new connections.
 void completed_data(Connection conn)
          The connection instance is returned to the Listener.
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
           
protected  void deliverConnection(Connection connection)
          Method the Acceptor implementation should call to pass an opened connection to the ORB.
 void destroy()
          The Listener is instructed to close its endpoint.
 Profile endpoint()
          Returns a copy of the profile describing the endpoint of this instance.
 void listen()
          It is possible that connection requests arrive after the initial creation of the Listener instance but before the conclusion of the configuration of the specific endpoint in this plugin.
 void set_handle(Handle up)
          This call establishes the link between the ORB (i.e. the Handle instance) and a server endpoint of the plugged-in transport.
 
Methods inherited from class org.omg.ETF._ListenerLocalBase
_ids
 
Methods inherited from class org.omg.CORBA.LocalObject
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_interface, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_policy_override, validate_connection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.omg.CORBA.Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_interface, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
 

Field Detail

orb

protected ORB orb
The ORB.


profile

protected Profile profile
The profile of this listener's endpoint.


acceptor

protected ListenerBase.Acceptor acceptor
The primary acceptor of this listener.


configuration

protected org.jacorb.config.Configuration configuration
The configuration.


logger

protected org.apache.avalon.framework.logger.Logger logger
The logger.


up

protected Handle up
Reference to the ORB, for delivering incoming connections via upcalls.


incoming_connections

protected java.util.List incoming_connections
Queue of incoming connections, which will be delivered via calls to the accept() method. Connections will only be put into this list if no Handle has been set.


terminated

protected boolean terminated
Constructor Detail

ListenerBase

public ListenerBase()

ListenerBase

public ListenerBase(ORB orb)
Deprecated.  

Method Detail

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

set_handle

public void set_handle(Handle up)
This call establishes the link between the ORB (i.e. the Handle instance) and a server endpoint of the plugged-in transport. All calls upwards into the ORB shall use the given instance.

Specified by:
set_handle in interface ListenerOperations

listen

public void listen()
It is possible that connection requests arrive after the initial creation of the Listener instance but before the conclusion of the configuration of the specific endpoint in this plugin. In order to provide a clear end of this configuration state, we added the listen() method. It is called by the ORB when it ready for incoming connection and thus signals the Listener instance to start processing the incoming connection requests. Therefore, a Listener instance shall not deliver incoming connections to the ORB before this method was called.

Specified by:
listen in interface ListenerOperations

deliverConnection

protected void deliverConnection(Connection connection)
Method the Acceptor implementation should call to pass an opened connection to the ORB.


accept

public Connection accept()
This call is an alternative to using set_handle() to initiate the callback-style of accepting new connections. This call blocks until a client connects to the server. Then a new Connection instance is returned. The transport plug-in must ensure that a thread blocked in accept() returns when destroy() is called with a null object reference. The transport plug-in must raise the CORBA::BAD_INV_ORDER with minor code {TBD} if the ORB calls this operation and set_handle() has ever been called previously on the same listener instance.

Specified by:
accept in interface ListenerOperations

completed_data

public void completed_data(Connection conn)
The connection instance is returned to the Listener. It now shall signal any incoming data to the Handle.

Specified by:
completed_data in interface ListenerOperations

destroy

public void destroy()
The Listener is instructed to close its endpoint. It shall no longer accept any connection requests and shall close all connections opened by it.

Specified by:
destroy in interface ListenerOperations

endpoint

public Profile endpoint()
Returns a copy of the profile describing the endpoint of this instance.

Specified by:
endpoint in interface ListenerOperations