org.jacorb.orb.etf

Class ConnectionBase

public abstract class ConnectionBase extends _ConnectionLocalBase implements Configurable

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

Version: $Id: ConnectionBase.java,v 1.3 2006/06/26 08:09:30 alphonse.bendt Exp $

Author: Nicolas Noffke Andre Spiegel

Field Summary
protected ByteArrayOutputStreamb_out
Optionally initialised to be used in the dumping of messages.
protected Configurationconfiguration
protected booleanconnected
protected Stringconnection_info
protected intfinalTimeout
Time out after a close connection has been received.
protected Loggerlogger
shared with sub classes
protected ORBorb
protected ProfileBaseprofile
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
voidconfigure(Configuration config)
protected StringgetLocalhost()
protected abstract intgetTimeout()
Profileget_server_profile()
booleanis_connected()
protected abstract voidsetTimeout(int timeout)
booleansupports_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_FAILUREto_COMM_FAILURE(IOException ex)
voidturnOnFinalTimeout()
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.
booleanuse_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).
booleanwait_next_data(long time_out)
Wait for the given time_out period for incoming data on this connection.

Field Detail

b_out

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

configuration

protected Configuration configuration

connected

protected boolean connected

connection_info

protected String connection_info

finalTimeout

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

logger

protected Logger logger
shared with sub classes

orb

protected ORB orb

profile

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

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(Configuration config)

getLocalhost

protected final String getLocalhost()

getTimeout

protected abstract int getTimeout()

get_server_profile

public Profile get_server_profile()

is_connected

public boolean is_connected()

setTimeout

protected abstract void setTimeout(int timeout)

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.

to_COMM_FAILURE

protected COMM_FAILURE to_COMM_FAILURE(IOException ex)

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.

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.

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.