public class SocketReceiver extends ReceiverBase implements java.lang.Runnable, SocketConnector.ExceptionHandler
ILoggingEvent
objects from a
remote appender over a Socket
.context
Constructor and Description |
---|
SocketReceiver() |
Modifier and Type | Method and Description |
---|---|
void |
connectionFailed(SocketConnector connector,
java.lang.Exception ex) |
protected java.lang.Runnable |
getRunnableTask()
Provides the runnable task this receiver will execute.
|
protected javax.net.SocketFactory |
getSocketFactory() |
protected SocketConnector |
newConnector(java.net.InetAddress address,
int port,
int initialDelay,
int retryDelay) |
protected void |
onStop()
Allows a subclass to participate in receiver shutdown.
|
void |
run() |
void |
setAcceptConnectionTimeout(int acceptConnectionTimeout) |
void |
setPort(int port) |
void |
setReconnectionDelay(int reconnectionDelay) |
void |
setRemoteHost(java.lang.String remoteHost) |
protected boolean |
shouldStart()
Determines whether this receiver should start.
|
isStarted, start, stop
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
protected boolean shouldStart()
Subclasses will implement this method to do any subclass-specific
validation. The subclass's ReceiverBase.getRunnableTask()
method will be
invoked (and the task returned will be submitted to the executor)
if and only if this method returns true
shouldStart
in class ReceiverBase
protected void onStop()
onStop
in class ReceiverBase
protected java.lang.Runnable getRunnableTask()
ReceiverBase
getRunnableTask
in class ReceiverBase
public void run()
run
in interface java.lang.Runnable
public void connectionFailed(SocketConnector connector, java.lang.Exception ex)
connectionFailed
in interface SocketConnector.ExceptionHandler
protected SocketConnector newConnector(java.net.InetAddress address, int port, int initialDelay, int retryDelay)
protected javax.net.SocketFactory getSocketFactory()
public void setRemoteHost(java.lang.String remoteHost)
public void setPort(int port)
public void setReconnectionDelay(int reconnectionDelay)
public void setAcceptConnectionTimeout(int acceptConnectionTimeout)