|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.qos.logback.core.net.SocketConnectorBase
public class SocketConnectorBase
Base implementation of SocketConnector.
| Nested Class Summary | |
|---|---|
static interface |
SocketConnectorBase.DelayStrategy
A strategy for choosing a delay after a failed connection attempt. |
| Nested classes/interfaces inherited from interface ch.qos.logback.core.net.SocketConnector |
|---|
SocketConnector.ExceptionHandler |
| Constructor Summary | |
|---|---|
SocketConnectorBase(InetAddress address,
int port,
int initialDelay,
int retryDelay)
Constructs a new connector. |
|
SocketConnectorBase(InetAddress address,
int port,
SocketConnectorBase.DelayStrategy delayStrategy)
Constructs a new connector. |
|
| Method Summary | |
|---|---|
Socket |
awaitConnection()
Blocks the calling thread until a connection is successfully established. |
Socket |
awaitConnection(long delay)
Blocks the calling thread until a connection is successfully established or timeout occurs. |
void |
run()
|
void |
setExceptionHandler(SocketConnector.ExceptionHandler exceptionHandler)
Sets the connector's exception handler. |
void |
setSocketFactory(SocketFactory socketFactory)
Sets the connector's socket factory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SocketConnectorBase(InetAddress address,
int port,
int initialDelay,
int retryDelay)
address - address of remote listenerport - port of remote listenerinitialDelay - delay before initial connection attemptretryDelay - delay after failed connection attempt
public SocketConnectorBase(InetAddress address,
int port,
SocketConnectorBase.DelayStrategy delayStrategy)
address - address of remote listenerport - port of remote listenerdelayStrategy - strategy for choosing the delay to impose before
each connection attempt| Method Detail |
|---|
public void run()
run in interface Runnable
public Socket awaitConnection()
throws InterruptedException
awaitConnection in interface SocketConnectorInterruptedException
public Socket awaitConnection(long delay)
throws InterruptedException
awaitConnection in interface SocketConnectornull if timeout occurs
InterruptedExceptionpublic void setExceptionHandler(SocketConnector.ExceptionHandler exceptionHandler)
The handler must be set before the Runnable.run() method is invoked.
setExceptionHandler in interface SocketConnectorexceptionHandler - the handler to setpublic void setSocketFactory(SocketFactory socketFactory)
If no factory is configured that connector will use the platform's default factory.
setSocketFactory in interface SocketConnectorsocketFactory - the factory to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||