com.ibm.ulc.comm
Class UlcTransport

java.lang.Object
  |
  +--com.ibm.ulc.comm.UlcTransport
Direct Known Subclasses:
UlcCorbaBasedTransport, UlcSocketTransport

public abstract class UlcTransport
extends java.lang.Object
implements java.io.Serializable, IDefaults

An abstraction for ULC transports.

See Also:
UlcConnection, Serialized Form

Field Summary
protected  UlcConnection fConnection
           
static boolean fgDebug
           
protected  boolean fTerminated
           
protected  UnboundedBuffer fWriterQueue
           
 
Fields inherited from interface com.ibm.ulc.base.IDefaults
BOX_BOTTOM, BOX_CENTER, BOX_CENTER_BOTTOM, BOX_CENTER_CENTER, BOX_CENTER_EXPAND, BOX_CENTER_TOP, BOX_EXPAND_BOTTOM, BOX_EXPAND_CENTER, BOX_EXPAND_EXPAND, BOX_EXPAND_TOP, BOX_LEFT, BOX_LEFT_BOTTOM, BOX_LEFT_CENTER, BOX_LEFT_EXPAND, BOX_LEFT_TOP, BOX_RIGHT, BOX_RIGHT_BOTTOM, BOX_RIGHT_CENTER, BOX_RIGHT_EXPAND, BOX_RIGHT_TOP, BOX_TOP, FILE_APPROVE_OPTION, FILE_CANCEL_OPTION, FILE_CUSTOM_DIALOG, FILE_DIRECTORIES_ONLY, FILE_ERROR_OPTION, FILE_FILES_AND_DIRECTORIES, FILE_FILES_ONLY, FILE_OPEN_DIALOG, FILE_SAVE_DIALOG, FORM_MODEL_ABOUT_TO_SAVE, FORM_MODEL_CHANGED, FORM_MODEL_INVALID, FORM_MODEL_UNSPECIFIED, FORM_NOTIFICATION_IMMEDIATE, FORM_NOTIFICATION_ON_FOCUS_CHANGE, FORM_NOTIFICATION_ON_REQUEST, LIST_MULTIPLE_INTERVAL_SELECTION, LIST_SINGLE_INTERVAL_SELECTION, LIST_SINGLE_SELECTION, MANDATORY_STYLE_BACKGROUND, MANDATORY_STYLE_BORDERED, MNEMONIC_INDICATOR, SCROLLBARS_ALWAYS, SCROLLBARS_AS_NEEDED, SCROLLBARS_NEVER, TABLE_AUTO_RESIZE_ALL_COLUMNS, TABLE_AUTO_RESIZE_LAST_COLUMN, TABLE_AUTO_RESIZE_OFF, TABLE_EDIT_UPDATE_ON_FOCUS_CHANGE, TABLE_EDIT_UPDATE_ON_REQUEST, TABLE_EDIT_UPDATE_ON_ROW_CHANGE, TABLE_MODEL_CELL_CHANGED, TABLE_MODEL_CONTENTS_CHANGED, TABLE_MODEL_ROWS_ADDED, TABLE_MODEL_ROWS_CHANGED, TABLE_MODEL_ROWS_REMOVED, TRANSPORT_EX_CONNECTION_INTERRUPTED, TRANSPORT_EX_INIT_CONNECTION_ERROR, TRANSPORT_EX_INIT_CONNECTION_EXCEPTION, TRANSPORT_EX_INIT_SERVER_EXCEPTION, TRANSPORT_EX_UNKNOWN_REASON, TREE_CONTIGUOUS_SELECTION, TREE_DISCONTIGUOUS_SELECTION, TREE_SINGLE_SELECTION, TREETABLE_FIRST_COLUMN_ATTRIBUTE_NAME, TRIGGER_ALL_SHELLS, TRIGGER_CHILD_WIDGETS, TRIGGER_ON_ACTION, TRIGGER_ON_ACTION_AND_SELECTION, TRIGGER_ON_SELECTION, TRIGGER_SHELL, TRIGGER_USER_DEFINED, TRIGGER_WIDGET
 
Constructor Summary
protected UlcTransport()
          UlcTransport constructor
  UlcTransport(java.lang.String urlString)
          UlcTransport constructor
 
Method Summary
 void close()
           
static UlcTransport create(java.lang.String urlString)
          The factory method to create a concrete transport depending on the protocol specified in the URL.
protected  void flushWriter()
          During the shutdown of the connection any pending requests in tbe output queue should be flushed before the connection is taken down.
 UlcConnection getConnection()
           
 java.lang.String getHost()
           
abstract  java.lang.String getLocalUrlString()
          Return an URL String describing this transports local endpoint.
 int getPort()
           
static java.util.Properties getProperties()
           
 java.lang.String getRemoteUrlString()
          Return an URL String describing this transports remote endpoint.
 java.lang.String getUrlFile()
           
 java.lang.String getUrlString()
          Return an URL String describing this transport's remote endpoint.
protected abstract  void initPeerConnection()
          Method to perform connection initialization with peer.
protected  void readRequests()
          Read loop.
abstract  boolean readsAsynch()
          Does the transport asynchronous reads itself? Otherwise it inherits the automatic asynchronous read support of this class by overriding readRequests().
 void receive(Request r)
           
 void send(Request r)
          Sends a request.
protected abstract  void sendDirect(Request r, boolean flush)
          Sends a request directly (without using WriterThread)
 void setConnection(UlcConnection connection)
           
protected  void setUrlString(java.lang.String urlString)
           
 void start()
           
protected abstract  void termPeerConnection()
          Method to perform connection termination with peer.
protected  void writeRequests()
          Write loop.
abstract  boolean writesAsynch()
          Does the transport asynchronous writes itself? Otherwise it inherits the automatic asynchronous write support of this class by overriding writeRequests().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fgDebug

public static boolean fgDebug

fConnection

protected UlcConnection fConnection

fWriterQueue

protected UnboundedBuffer fWriterQueue

fTerminated

protected boolean fTerminated
Constructor Detail

UlcTransport

protected UlcTransport()
UlcTransport constructor

UlcTransport

public UlcTransport(java.lang.String urlString)
UlcTransport constructor
Parameters:
urlString - java.lang.String
Method Detail

close

public void close()

create

public static UlcTransport create(java.lang.String urlString)
                           throws UlcTransportException
The factory method to create a concrete transport depending on the protocol specified in the URL. The name of the concrete transport class is read in from a property file.
Parameters:
urlString - java.lang.String

flushWriter

protected void flushWriter()
During the shutdown of the connection any pending requests in tbe output queue should be flushed before the connection is taken down. Subclasses should override this method to implement any logic necessary to flush the output queue

getConnection

public UlcConnection getConnection()

getHost

public java.lang.String getHost()

getLocalUrlString

public abstract java.lang.String getLocalUrlString()
Return an URL String describing this transports local endpoint.

getPort

public int getPort()

getProperties

public static java.util.Properties getProperties()

getRemoteUrlString

public java.lang.String getRemoteUrlString()
Return an URL String describing this transports remote endpoint. Default implementation is to return the localUrlString.

getUrlFile

public java.lang.String getUrlFile()

getUrlString

public java.lang.String getUrlString()
Return an URL String describing this transport's remote endpoint.

initPeerConnection

protected abstract void initPeerConnection()
                                    throws UlcTransportException
Method to perform connection initialization with peer.

readRequests

protected void readRequests()
Read loop. Data read from Transport must be passed as requests to associated request processor for execution.

readsAsynch

public abstract boolean readsAsynch()
Does the transport asynchronous reads itself? Otherwise it inherits the automatic asynchronous read support of this class by overriding readRequests().

receive

public final void receive(Request r)

send

public final void send(Request r)
Sends a request. Requests are sent asynchronously.

sendDirect

protected abstract void sendDirect(Request r,
                                   boolean flush)
Sends a request directly (without using WriterThread)

setConnection

public void setConnection(UlcConnection connection)

setUrlString

protected void setUrlString(java.lang.String urlString)

start

public final void start()
                 throws UlcTransportException

termPeerConnection

protected abstract void termPeerConnection()
Method to perform connection termination with peer.

writeRequests

protected void writeRequests()
Write loop. Requests coming in from associated request queue must be written to outgoing transport.

writesAsynch

public abstract boolean writesAsynch()
Does the transport asynchronous writes itself? Otherwise it inherits the automatic asynchronous write support of this class by overriding writeRequests().