Package ch.qos.logback.classic.net
Class ReceiverBase
- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- ch.qos.logback.classic.net.ReceiverBase
-
- All Implemented Interfaces:
ContextAware,LifeCycle
- Direct Known Subclasses:
ServerSocketReceiver,SocketReceiver
public abstract class ReceiverBase extends ContextAwareBase implements LifeCycle
An abstract base for components that receive logging events from a remote peer and log according to local policy
-
-
Field Summary
Fields Modifier and Type Field Description private booleanstarted-
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
-
Constructor Summary
Constructors Constructor Description ReceiverBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.lang.RunnablegetRunnableTask()Provides the runnable task this receiver will execute.booleanisStarted()protected abstract voidonStop()Allows a subclass to participate in receiver shutdown.protected abstract booleanshouldStart()Determines whether this receiver should start.voidstart()voidstop()-
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
-
-
-
-
Method Detail
-
shouldStart
protected abstract boolean shouldStart()
Determines whether this receiver should start.Subclasses will implement this method to do any subclass-specific validation. The subclass's
getRunnableTask()method will be invoked (and the task returned will be submitted to the executor) if and only if this method returnstrue- Returns:
- flag indicating whether this receiver should start
-
onStop
protected abstract void onStop()
Allows a subclass to participate in receiver shutdown.
-
getRunnableTask
protected abstract java.lang.Runnable getRunnableTask()
Provides the runnable task this receiver will execute.- Returns:
- runnable task
-
-