|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.ulc.util.UlcObject | +--com.ibm.ulc.comm.UlcConnection
A connection to a ULC peer. A RequestProcessor is used to pass requests coming from the peer to an event loop. The send() method allows a caller to pass a request to the peer. An instance of an UlcTransport is used for the actual communication. Incoming and outgoing communication is asynchronous.
IRequestProcessor
,
UlcTransport
, Serialized FormField Summary | |
static boolean |
fgDebug
|
static boolean |
fgIPAddr
|
static int |
INVALIDPORT
|
Constructor Summary | |
protected |
UlcConnection(java.lang.String urlString,
IRequestProcessor rp,
java.lang.String connId,
java.lang.String clientData)
Creates a connection for the given url, request processor, and connection identification data. |
protected |
UlcConnection(UlcTransport transport,
IRequestProcessor rp,
java.lang.String connId,
java.lang.String clientData)
Creates a connection for the given transport, request processor, and connection identification data. |
Method Summary | |
void |
addRequestListener(IRequestListener listener)
Register an IRequestListener that will be notified each time a request is sent or received. |
void |
close()
Closes the connection (including the transport) |
abstract Request |
createRequest()
Creates a request. |
void |
finalize()
|
java.lang.String |
getApplicationName()
|
java.lang.String |
getClientData()
|
static java.lang.String |
getFileFromUrlString(java.lang.String urlString)
Helper method to extract the 'file' part from a URL string. |
java.lang.String |
getHost()
|
static java.lang.String |
getHostFromUrlString(java.lang.String urlString)
Helper method to extract the 'host' part from a URL string. |
java.lang.String |
getId()
|
static java.lang.String |
getLocalHost()
Helper method to return the local host either as host name or as IP address (dotted string) depending on preference set. |
java.lang.String |
getLocalUrlString()
Return a URL string that identifies the local end point of the connection. |
int |
getPort()
|
static int |
getPortFromUrlString(java.lang.String urlString)
Helper method to extract the 'port' part from a URL string. |
static java.lang.String |
getProtocolFromUrlString(java.lang.String urlString)
Helper method to extract the 'protocol' part from a URL string. |
static java.lang.String |
getReferenceFromUrlString(java.lang.String urlString)
Helper method to extract the 'reference' ('anchor') part from a URL string. |
java.lang.String |
getRemoteUrlString()
Return a URL string that identifies the remote end point of the connection. |
IRequestFilter |
getRequestFilter()
Returns the IRequestFilter object that is currently installed or null. |
java.util.Vector |
getRequestListeners()
Returns the vector of currently registered IRequestListener objects or null. |
UlcTransport |
getTransport()
|
java.lang.String |
getUrlString()
Return a URL string that identifies the remote end point of the connection. |
boolean |
isTerminated()
|
void |
postRequest(Request r)
Posts a request to the connection's request queue. |
boolean |
receive(Request request)
Receives a request and posts it to the connection's request queue. |
void |
removeRequestListener(IRequestListener listener)
Remove a previously registered IRequestListener |
boolean |
send(Request request)
Sends a request out using the installed transport. |
void |
setRequestFilter(IRequestFilter filter)
Set the IRequestFilter object that will receive all requests just before they are sent and all requests just after they are recieved. |
protected abstract void |
shutdownHook()
A hook that can be overridden to add additional actions when the connection is shut down. |
void |
start()
Starts the connection. |
Methods inherited from class com.ibm.ulc.util.UlcObject |
trouble,
trouble2,
trouble2Err,
troubleErr |
Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static boolean fgIPAddr
public static boolean fgDebug
public static final int INVALIDPORT
Constructor Detail |
protected UlcConnection(UlcTransport transport, IRequestProcessor rp, java.lang.String connId, java.lang.String clientData)
transport
- com.ibm.ulc.comm.UlcTransportrp
- com.ibm.ulc.comm.IRequestProcessorconnId
- java.lang.StringclientData
- java.lang.StringUlcTransport
protected UlcConnection(java.lang.String urlString, IRequestProcessor rp, java.lang.String connId, java.lang.String clientData)
urlString
- java.lang.Stringrp
- com.ibm.ulc.comm.IRequestProcessorconnId
- java.lang.StringclientData
- java.lang.StringUlcTransport
Method Detail |
public void addRequestListener(IRequestListener listener)
IRequestListener
public void close()
public abstract Request createRequest()
public void finalize() throws java.lang.Throwable
public java.lang.String getApplicationName()
public java.lang.String getClientData()
public static java.lang.String getFileFromUrlString(java.lang.String urlString)
public java.lang.String getHost()
public static java.lang.String getHostFromUrlString(java.lang.String urlString)
public java.lang.String getId()
public static java.lang.String getLocalHost()
public java.lang.String getLocalUrlString()
public int getPort()
public static int getPortFromUrlString(java.lang.String urlString)
public static java.lang.String getProtocolFromUrlString(java.lang.String urlString)
public static java.lang.String getReferenceFromUrlString(java.lang.String urlString)
public java.lang.String getRemoteUrlString()
public IRequestFilter getRequestFilter()
public java.util.Vector getRequestListeners()
public UlcTransport getTransport()
public java.lang.String getUrlString()
public boolean isTerminated()
public void postRequest(Request r)
public final boolean receive(Request request)
public void removeRequestListener(IRequestListener listener)
public final boolean send(Request request)
public void setRequestFilter(IRequestFilter filter)
IRequestFilter
protected abstract void shutdownHook()
public void start() throws UlcTransportException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |