public interface SocketConnector
extends java.util.concurrent.Callable<java.net.Socket>
Runnable
that (re)connects a socket.
An implementation of this interface is responsible for repeatedly attempting to create a socket connection to a remote host.
Modifier and Type | Interface and Description |
---|---|
static interface |
SocketConnector.ExceptionHandler
An exception handler that is notified of all exceptions that occur
during the (re)connection process.
|
Modifier and Type | Method and Description |
---|---|
java.net.Socket |
call()
Blocks the calling thread until a connection is successfully
established.
|
void |
setExceptionHandler(SocketConnector.ExceptionHandler exceptionHandler)
Sets the connector's exception handler.
|
void |
setSocketFactory(javax.net.SocketFactory socketFactory)
Sets the connector's socket factory.
|
java.net.Socket call() throws java.lang.InterruptedException
call
in interface java.util.concurrent.Callable<java.net.Socket>
java.lang.InterruptedException
void setExceptionHandler(SocketConnector.ExceptionHandler exceptionHandler)
The handler must be set before the call()
method is invoked.
exceptionHandler
- the handler to setvoid setSocketFactory(javax.net.SocketFactory socketFactory)
If no factory is configured that connector will use the platform's default factory.
socketFactory
- the factory to setCopyright © 2010 - 2020 Adobe. All Rights Reserved