|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.comm.socket.AbstractSocketWrapper
org.jppf.comm.socket.BootstrapSocketClient
public class BootstrapSocketClient
This class provides a simple API to transfer objects over a TCP socket connection.
| Field Summary |
|---|
| Fields inherited from class org.jppf.comm.socket.AbstractSocketWrapper |
|---|
dis, dos, host, opened, port, serializer, socket |
| Fields inherited from interface org.jppf.comm.socket.SocketWrapper |
|---|
SOCKET_RECEIVE_BUFFER_SIZE |
| Constructor Summary | |
|---|---|
BootstrapSocketClient()
Default constructor is invisible to other classes. |
|
BootstrapSocketClient(Socket socket)
Initialize this socket client with an already opened and connected socket. |
|
BootstrapSocketClient(String host,
int port)
Initialize this socket client and connect it to the specified host on the specified port. |
|
| Method Summary | |
|---|---|
ObjectSerializer |
getSerializer()
Get the object serializer for this socket connection. |
Object |
receive(int timeout)
Read an object from a TCP socket connection. |
void |
send(Object o)
Send an object over a TCP socket connection. |
| Methods inherited from class org.jppf.comm.socket.AbstractSocketWrapper |
|---|
checkOpened, close, flush, getHost, getPort, getSocket, getSocketTimestamp, initStreams, isOpened, open, read, readInt, receive, receiveBytes, sendBytes, setHost, setPort, setSerializer, setSocket, skip, updateSocketTimestamp, write, writeInt |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BootstrapSocketClient()
BootstrapSocketClient(String, int)
public BootstrapSocketClient(String host,
int port)
throws ConnectException,
IOException
host - the remote host this socket client connects to.port - the remote port on the host this socket client connects to.
ConnectException - if the connection fails.
IOException - if there is an issue with the socket streams.
public BootstrapSocketClient(Socket socket)
throws JPPFException
socket - the underlying socket this socket client wraps around.
JPPFException - if the socket connection fails.| Method Detail |
|---|
public void send(Object o)
throws Exception
o - the object to send.
Exception - if the underlying output stream throws an exception.
public Object receive(int timeout)
throws Exception
timeout - timeout after which the operation is aborted. A timeout of zero is interpreted as an infinite timeout.
Exception - if the underlying input stream throws an exception.public ObjectSerializer getSerializer()
getSerializer in interface SocketWrappergetSerializer in class AbstractSocketWrapperObjectSerializer.AbstractSocketWrapper.getSerializer()
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||