|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.petals.transport.platform.nio.client.NioClientAgent
public class NioClientAgent
A client agent of the NIO transporter.
| Constructor Summary | |
|---|---|
NioClientAgent(java.util.logging.Logger logger,
NioSelector selectorAgent)
NIO Client constructor. |
|
| Method Summary | |
|---|---|
void |
connect(java.lang.String host,
int port,
long connectionTimeout)
Realize a connection to the server part. |
void |
disconnect()
|
boolean |
isUsable()
This client can be used (i.e. |
void |
onClose(java.nio.channels.SocketChannel socketChannel)
The callback caller will close the socket channel next. |
void |
onConnectionError(java.io.IOException exception)
|
void |
onIsConnected(OutputSocketChannelContext oscc)
Callbacks used by the TCP connection process |
void |
onIsWritten()
Callbacks used by the TCP write process |
void |
onWriteError(java.io.IOException exception)
|
void |
send(java.lang.Object obj,
long timeout)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NioClientAgent(java.util.logging.Logger logger,
NioSelector selectorAgent)
throws java.io.IOException
logger - selectorAgent - serializationCacheCleanPeriod -
java.io.IOException| Method Detail |
|---|
public void connect(java.lang.String host,
int port,
long connectionTimeout)
throws java.io.IOException
host - IP adress of the NIO server agentport - TCP port of the NIO server agentconnectionTimeout - Connection timeout in millisecond
java.io.IOExceptionpublic void onIsConnected(OutputSocketChannelContext oscc)
NioClient
onIsConnected in interface NioClientorg.ow2.petals.extensions.transporter.nio.selector.NioClient#onIsConnected(org.ow2.petals.extensions.transporter.nio.selector.OutputSocketChannelContext)public void onConnectionError(java.io.IOException exception)
onConnectionError in interface NioClientorg.ow2.petals.extensions.transporter.nio.selector.NioClient#onConnectionError(java.io.IOException)
public void send(java.lang.Object obj,
long timeout)
throws java.io.IOException,
java.lang.InterruptedException
send in interface NioClientjava.io.IOException
java.lang.InterruptedException
public void onIsWritten()
throws java.io.IOException
NioClient
onIsWritten in interface NioClientjava.io.IOExceptionorg.ow2.petals.extensions.transporter.nio.selector.NioClient#onIsWritten()
public void onWriteError(java.io.IOException exception)
throws java.io.IOException
onWriteError in interface NioClientjava.io.IOExceptionorg.ow2.petals.extensions.transporter.nio.selector.NioClient#onWriteError(java.io.IOException)public void onClose(java.nio.channels.SocketChannel socketChannel)
NioClient
onClose in interface NioClientsocketChannel - The socket channel that has been detected as closed.org.ow2.petals.extensions.transporter.nio.selector.NioClient#onClose(java.nio.channels.SocketChannel)
public void disconnect()
throws java.io.IOException
java.io.IOExceptionpublic boolean isUsable()
This client can be used (i.e. the TCP connection is valid) ?
This method is thread-safe.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||