org.jacorb.orb.etf
Class ConnectionBase

java.lang.Object
  extended byorg.omg.CORBA.LocalObject
      extended byorg.omg.ETF._ConnectionLocalBase
          extended byorg.jacorb.orb.etf.ConnectionBase
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable, Connection, ConnectionOperations, IDLEntity, LocalInterface, Object, java.io.Serializable
Direct Known Subclasses:
StreamConnectionBase

public abstract class ConnectionBase
extends _ConnectionLocalBase
implements org.apache.avalon.framework.configuration.Configurable

This an abstract base implementation of the ETF::Connection interface.

Version:
$Id: ConnectionBase.java,v 1.2 2005/11/11 19:31:44 alphonse.bendt Exp $
Author:
Nicolas Noffke / Andre Spiegel
See Also:
Serialized Form

Field Summary
protected  java.io.ByteArrayOutputStream b_out
          Optionally initialised to be used in the dumping of messages.
protected  org.jacorb.config.Configuration configuration
           
protected  boolean connected
           
protected  java.lang.String connection_info
           
protected  int finalTimeout
          Time out after a close connection has been received.
protected  org.apache.avalon.framework.logger.Logger logger
          shared with sub classes
protected  ProfileBase profile
          The Profile of the target / server side of the connection.
 
Constructor Summary
protected ConnectionBase()
           
protected ConnectionBase(ConnectionBase other)
          Initialise this instance as a copy of another.
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration config)
           
 Profile get_server_profile()
           
protected abstract  int getTimeout()
           
 boolean is_connected()
           
protected abstract  void setTimeout(int timeout)
           
 boolean supports_callback()
          A boolean flag describing whether this connection supports the Bidirectional GIOP mechanism as described by GIOP-1.2 in CORBA 2.3.1 (OMG Document: formal/99-10-07).
protected  COMM_FAILURE to_COMM_FAILURE(java.io.IOException ex)
           
 void turnOnFinalTimeout()
          This is used to tell the transport that a CloseConnection has been sent, and that it should set a timeout in case the client doesn't close its side of the connection right away.
 boolean use_handle_time_out()
          A flag directing the ORB to use either the Handle class to perform data queries with a time_out, or the transport layer (through this connection).
 boolean wait_next_data(long time_out)
          Wait for the given time_out period for incoming data on this connection.
 
Methods inherited from class org.omg.ETF._ConnectionLocalBase
_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.ETF.ConnectionOperations
close, connect, flush, is_data_available, read, write
 
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

connected

protected boolean connected

b_out

protected java.io.ByteArrayOutputStream b_out
Optionally initialised to be used in the dumping of messages. See property jacorb.debug.dump_outgoing_messages. Default is off.


finalTimeout

protected int finalTimeout
Time out after a close connection has been received. See property jacorb.connection.timeout_after_closeconnection. Default 20000 milliseconds.


profile

protected ProfileBase profile
The Profile of the target / server side of the connection.


logger

protected org.apache.avalon.framework.logger.Logger logger
shared with sub classes


configuration

protected org.jacorb.config.Configuration configuration

connection_info

protected java.lang.String connection_info
Constructor Detail

ConnectionBase

protected ConnectionBase()

ConnectionBase

protected ConnectionBase(ConnectionBase other)
Initialise this instance as a copy of another. Intended for use within subclass constructors.

Method Detail

configure

public void configure(org.apache.avalon.framework.configuration.Configuration config)
               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

setTimeout

protected abstract void setTimeout(int timeout)

getTimeout

protected abstract int getTimeout()

get_server_profile

public Profile get_server_profile()
Specified by:
get_server_profile in interface ConnectionOperations

is_connected

public boolean is_connected()
Specified by:
is_connected in interface ConnectionOperations

turnOnFinalTimeout

public void turnOnFinalTimeout()
This is used to tell the transport that a CloseConnection has been sent, and that it should set a timeout in case the client doesn't close its side of the connection right away. This should only be called on the thread that listens on the socket because timeouts are not applied until read() is called the next time.


to_COMM_FAILURE

protected COMM_FAILURE to_COMM_FAILURE(java.io.IOException ex)

wait_next_data

public boolean wait_next_data(long time_out)
Wait for the given time_out period for incoming data on this connection. It shall return false if this call times out and no data is available. It may not throw a TIMEOUT exception. If data can already be read or arrives before the end of the time out, this function shall return true, immediately.

Specified by:
wait_next_data in interface ConnectionOperations

supports_callback

public boolean supports_callback()
A boolean flag describing whether this connection supports the Bidirectional GIOP mechanism as described by GIOP-1.2 in CORBA 2.3.1 (OMG Document: formal/99-10-07). It shall return true if it does, and false if it does not.

Specified by:
supports_callback in interface ConnectionOperations

use_handle_time_out

public boolean use_handle_time_out()
A flag directing the ORB to use either the Handle class to perform data queries with a time_out, or the transport layer (through this connection). The instance shall return true, if the Handle should signal time outs for read operations. Then the ORB may not call wait_next_data. Otherwise, a false shall be returned, and the function wait_next_data shall be implemented by this class.

Specified by:
use_handle_time_out in interface ConnectionOperations