ch.qos.logback.classic.net
Class SocketReceiver
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.classic.net.ReceiverBase
ch.qos.logback.classic.net.SocketReceiver
- All Implemented Interfaces:
- SocketConnector.ExceptionHandler, ContextAware, LifeCycle, Runnable
- Direct Known Subclasses:
- SSLSocketReceiver
public class SocketReceiver
- extends ReceiverBase
- implements Runnable, SocketConnector.ExceptionHandler
A component that receives serialized ILoggingEvent
objects from a
remote appender over a Socket
.
- Author:
- Carl Harris
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase |
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SocketReceiver
public SocketReceiver()
shouldStart
protected boolean shouldStart()
- Determines whether this receiver should start.
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
- Specified by:
shouldStart
in class ReceiverBase
- Returns:
- flag indicating whether this receiver should start
onStop
protected void onStop()
- Allows a subclass to participate in receiver shutdown.
- Specified by:
onStop
in class ReceiverBase
getRunnableTask
protected Runnable getRunnableTask()
- Description copied from class:
ReceiverBase
- Provides the runnable task this receiver will execute.
- Specified by:
getRunnableTask
in class ReceiverBase
- Returns:
- runnable task
run
public void run()
-
- Specified by:
run
in interface Runnable
connectionFailed
public void connectionFailed(SocketConnector connector,
Exception ex)
-
- Specified by:
connectionFailed
in interface SocketConnector.ExceptionHandler
newConnector
protected SocketConnector newConnector(InetAddress address,
int port,
int initialDelay,
int retryDelay)
getSocketFactory
protected SocketFactory getSocketFactory()
setRemoteHost
public void setRemoteHost(String remoteHost)
setPort
public void setPort(int port)
setReconnectionDelay
public void setReconnectionDelay(int reconnectionDelay)
setAcceptConnectionTimeout
public void setAcceptConnectionTimeout(int acceptConnectionTimeout)
Copyright © 2005-2013 QOS.ch. All Rights Reserved.