com.ibm.ulc.comm
Class UlcSocketTransport

java.lang.Object
  |
  +--com.ibm.ulc.comm.UlcTransport
        |
        +--com.ibm.ulc.comm.UlcSocketTransport

public class UlcSocketTransport
extends UlcTransport

An implemention for ULC transports using sockets.

See Also:
UlcTransport, Serialized Form

Fields inherited from class com.ibm.ulc.comm.UlcTransport
fConnection, fgDebug, fTerminated, fWriterQueue
 
Constructor Summary
UlcSocketTransport()
          UlcSocketTransport constructor.
UlcSocketTransport(java.net.Socket socket)
          UlcSocketTransport constructor.
UlcSocketTransport(java.lang.String urlString)
          UlcSocketTransport constructor.
 
Method Summary
 java.net.Socket createSocket(java.lang.String urlString)
          Factory method for creating sockets
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.
 java.lang.String getLocalUrlString()
          Return an URL String describing this transports local endpoint.
 java.lang.String getRemoteUrlString()
          Return an URL String describing this transports remote endpoint.
 java.net.Socket getSocket()
           
protected  void initPeerConnection()
          Initialize connection to peer if necessary.
protected  void readRequests()
          Read loop.
 boolean readsAsynch()
          Does the transport asynchronous reads itself? Otherwise it inherits the automatic asynchronous read support of this class by overriding readRequests().
protected  void sendDirect(Request r, boolean flush)
          Sends a request directly (without using WriterThread)
protected  void termPeerConnection()
          Method to perform connection termination with peer.
protected  void writeRequests()
          Write loop.
 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 com.ibm.ulc.comm.UlcTransport
close, create, getConnection, getHost, getPort, getProperties, getUrlFile, getUrlString, receive, send, setConnection, setUrlString, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UlcSocketTransport

public UlcSocketTransport()
UlcSocketTransport constructor.

UlcSocketTransport

public UlcSocketTransport(java.lang.String urlString)
UlcSocketTransport constructor. Will use the passed in URL to create a socket connection.
Parameters:
urlString - java.lang.String

UlcSocketTransport

public UlcSocketTransport(java.net.Socket socket)
UlcSocketTransport constructor. Will use the passed in socket for connection.
Method Detail

createSocket

public java.net.Socket createSocket(java.lang.String urlString)
                             throws java.net.UnknownHostException,
                                    java.io.IOException
Factory method for creating sockets

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
Overrides:
flushWriter in class UlcTransport

getLocalUrlString

public java.lang.String getLocalUrlString()
Description copied from class: UlcTransport
Return an URL String describing this transports local endpoint.
Overrides:
getLocalUrlString in class UlcTransport

getRemoteUrlString

public java.lang.String getRemoteUrlString()
Description copied from class: UlcTransport
Return an URL String describing this transports remote endpoint. Default implementation is to return the localUrlString.
Overrides:
getRemoteUrlString in class UlcTransport

getSocket

public java.net.Socket getSocket()

initPeerConnection

protected void initPeerConnection()
                           throws UlcTransportException
Initialize connection to peer if necessary.
Overrides:
initPeerConnection in class UlcTransport

readRequests

protected void readRequests()
Description copied from class: UlcTransport
Read loop. Data read from Transport must be passed as requests to associated request processor for execution.
Overrides:
readRequests in class UlcTransport

readsAsynch

public boolean readsAsynch()
Description copied from class: UlcTransport
Does the transport asynchronous reads itself? Otherwise it inherits the automatic asynchronous read support of this class by overriding readRequests().
Overrides:
readsAsynch in class UlcTransport

sendDirect

protected void sendDirect(Request r,
                          boolean flush)
Description copied from class: UlcTransport
Sends a request directly (without using WriterThread)
Overrides:
sendDirect in class UlcTransport

termPeerConnection

protected void termPeerConnection()
Description copied from class: UlcTransport
Method to perform connection termination with peer.
Overrides:
termPeerConnection in class UlcTransport

writeRequests

protected void writeRequests()
Description copied from class: UlcTransport
Write loop. Requests coming in from associated request queue must be written to outgoing transport.
Overrides:
writeRequests in class UlcTransport

writesAsynch

public boolean writesAsynch()
Description copied from class: UlcTransport
Does the transport asynchronous writes itself? Otherwise it inherits the automatic asynchronous write support of this class by overriding writeRequests().
Overrides:
writesAsynch in class UlcTransport