Module ch.qos.logback.core
Package ch.qos.logback.core.net.server
Class AbstractServerSocketAppender<E>
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.AppenderBase<E>
ch.qos.logback.core.net.server.AbstractServerSocketAppender<E>
- All Implemented Interfaces:
Appender<E>,ContextAware,FilterAttachable<E>,LifeCycle
- Direct Known Subclasses:
ServerSocketAppender,SSLServerSocketAppenderBase
This is the super class for module specific ServerSocketAppender
implementations can derive from.
- Author:
- Carl Harris
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefaultServerSocketbacklogstatic final intDefault queue size used for each clientFields inherited from class ch.qos.logback.core.AppenderBase
name, startedFields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected ServerListener<ch.qos.logback.core.net.server.RemoteReceiverClient> createServerListener(ServerSocket socket) protected ServerRunner<ch.qos.logback.core.net.server.RemoteReceiverClient> createServerRunner(ServerListener<ch.qos.logback.core.net.server.RemoteReceiverClient> listener, Executor executor) Gets the local address for the listener.intGets the listener queue depth.intGets the event queue size used for each client connection.protected InetAddressGets the local address for the listener.intgetPort()Gets the local port for the listener.protected abstract PreSerializationTransformer<E> getPST()Gets a transformer that will be used to convert a received event to aSerializableform.protected ServerSocketFactoryGets the factory used to createServerSocketobjects.protected abstract voidpostProcessEvent(E event) Postprocess an event received viaappend().voidsetAddress(String address) Sets the local address for the listener.voidsetBacklog(int backlog) Sets the listener queue depth.voidsetClientQueueSize(int clientQueueSize) Sets the event queue size used for each client connection.voidsetPort(int port) Sets the local port for the listener.voidstart()voidstop()Methods inherited from class ch.qos.logback.core.AppenderBase
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toStringMethods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ch.qos.logback.core.spi.ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
-
Field Details
-
DEFAULT_BACKLOG
-
DEFAULT_CLIENT_QUEUE_SIZE
-
-
Constructor Details
-
AbstractServerSocketAppender
public AbstractServerSocketAppender()
-
-
Method Details
-
start
-
createServerListener
protected ServerListener<ch.qos.logback.core.net.server.RemoteReceiverClient> createServerListener(ServerSocket socket) -
createServerRunner
protected ServerRunner<ch.qos.logback.core.net.server.RemoteReceiverClient> createServerRunner(ServerListener<ch.qos.logback.core.net.server.RemoteReceiverClient> listener, Executor executor) -
stop
-
append
- Specified by:
appendin classAppenderBase<E>
-
postProcessEvent
Postprocess an event received viaappend().- Parameters:
event-
-
getPST
Gets a transformer that will be used to convert a received event to aSerializableform.- Returns:
-
getServerSocketFactory
Gets the factory used to createServerSocketobjects.The default implementation delegates to
ServerSocketFactory.getDefault(). Subclasses may override to private a different socket factory implementation.- Returns:
- socket factory.
- Throws:
Exception
-
getInetAddress
Gets the local address for the listener.- Returns:
- an
InetAddressrepresentation of the local address. - Throws:
UnknownHostException
-
getPort
-
setPort
Sets the local port for the listener.- Parameters:
port- the local port to set
-
getBacklog
Gets the listener queue depth.This represents the number of connected clients whose connections have not yet been accepted.
- Returns:
- queue depth
- See Also:
-
setBacklog
Sets the listener queue depth.This represents the number of connected clients whose connections have not yet been accepted.
- Parameters:
backlog- the queue depth to set- See Also:
-
getAddress
Gets the local address for the listener.- Returns:
- a string representation of the local address
-
setAddress
Sets the local address for the listener.- Parameters:
address- a host name or a string representation of an IP address
-
getClientQueueSize
Gets the event queue size used for each client connection.- Returns:
- queue size
-
setClientQueueSize
Sets the event queue size used for each client connection.- Parameters:
clientQueueSize- the queue size to set
-