|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread org.acplt.oncrpc.OncRpcTcpSocketHelper.Connectiator
private class OncRpcTcpSocketHelper.Connectiator
The class Connectiator
has a short and sometimes sad
life, as its only purpose is trying to connect to a TCP port at
another host machine.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private java.net.InetAddress |
address
Host to connect to. |
private boolean |
hitTheBucket
Flag to indicate that the socket is not needed, as the caller timed out. |
private java.io.IOException |
ioexception
IOException caused by connection attempt, if any,
or null . |
private int |
port
TCP port to connect to. |
private java.net.Socket |
socket
Socket object, if the connection could be established, or null . |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
OncRpcTcpSocketHelper.Connectiator(java.net.InetAddress address,
int port)
Construct a new Connectiator that can later be used
connect to the given TCP port at the host specified. |
Method Summary | |
---|---|
java.io.IOException |
getIOException()
Return exception caused by connection operation, if any, or null if no exception was thrown. |
java.net.Socket |
getSocket()
Return socket created by connection establishment, or null if the connection could not be established. |
void |
notRequiredAnyMore()
Indicates that the caller initiating this Thread is not interested in its results any more. |
void |
run()
|
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.net.InetAddress address
private int port
private java.io.IOException ioexception
IOException
caused by connection attempt, if any,
or null
.
private java.net.Socket socket
null
.
private boolean hitTheBucket
Constructor Detail |
---|
public OncRpcTcpSocketHelper.Connectiator(java.net.InetAddress address, int port)
Connectiator
that can later be used
connect to the given TCP port at the host specified. Note that we
do not try to establish the connection yet; this has to be done
later using the run()
method.
Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public java.io.IOException getIOException()
null
if no exception was thrown.
Note that we do not need to synchronize this method as the caller calls us when it is already holding the lock on us.
null
.public java.net.Socket getSocket()
null
if the connection could not be established.
Note that we do not need to synchronize this method as the caller calls us when it is already holding the lock on us.
null
.public void notRequiredAnyMore()
Note that we do not need to synchronize this method as the caller calls us when it is already holding the lock on us.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |