public abstract class AbstractServerSocketAppender<E> extends AppenderBase<E>
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BACKLOG
Default
ServerSocket backlog |
static int |
DEFAULT_CLIENT_QUEUE_SIZE
Default queue size used for each client
|
name, started
context
Constructor and Description |
---|
AbstractServerSocketAppender() |
Modifier and Type | Method and Description |
---|---|
protected void |
append(E event) |
protected 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) |
String |
getAddress()
Gets the local address for the listener.
|
int |
getBacklog()
Gets the listener queue depth.
|
int |
getClientQueueSize()
Gets the event queue size used for each client connection.
|
protected InetAddress |
getInetAddress()
Gets the local address for the listener.
|
int |
getPort()
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 a
Serializable form. |
protected ServerSocketFactory |
getServerSocketFactory()
Gets the factory used to create
ServerSocket objects. |
protected abstract void |
postProcessEvent(E event)
Post process an event received via
append(E) . |
void |
setAddress(String address)
Sets the local address for the listener.
|
void |
setBacklog(int backlog)
Sets the listener queue depth.
|
void |
setClientQueueSize(int clientQueueSize)
Sets the event queue size used for each client connection.
|
void |
setPort(int port)
Sets the local port for the listener.
|
void |
start() |
void |
stop() |
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toString
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
public static final int DEFAULT_BACKLOG
ServerSocket
backlogpublic static final int DEFAULT_CLIENT_QUEUE_SIZE
public void start()
start
in interface LifeCycle
start
in class AppenderBase<E>
protected 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)
public void stop()
stop
in interface LifeCycle
stop
in class AppenderBase<E>
protected void append(E event)
append
in class AppenderBase<E>
protected abstract void postProcessEvent(E event)
append(E)
.event
- the log eventprotected abstract PreSerializationTransformer<E> getPST()
Serializable
form.protected ServerSocketFactory getServerSocketFactory() throws Exception
ServerSocket
objects.
The default implementation delegates to
ServerSocketFactory.getDefault()
. Subclasses may override to
private a different socket factory implementation.
Exception
- could not get socket factoryprotected InetAddress getInetAddress() throws UnknownHostException
InetAddress
representation of the local address.UnknownHostException
- could not determine local addresspublic int getPort()
public void setPort(int port)
port
- the local port to setpublic int getBacklog()
This represents the number of connected clients whose connections have not yet been accepted.
ServerSocket
public void setBacklog(int backlog)
This represents the number of connected clients whose connections have not yet been accepted.
backlog
- the queue depth to setServerSocket
public String getAddress()
public void setAddress(String address)
address
- a host name or a string representation of an IP addresspublic int getClientQueueSize()
public void setClientQueueSize(int clientQueueSize)
clientQueueSize
- the queue size to setCopyright © 2005–2014 QOS.ch. All rights reserved.