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:
SSLServerSocketAppenderBase

public abstract class AbstractServerSocketAppender<E> extends AppenderBase<E>
This is the super class for module specific ServerSocketAppender implementations can derive from.
Author:
Carl Harris
  • Field Details

    • DEFAULT_BACKLOG

      public static final int DEFAULT_BACKLOG
      Default ServerSocket backlog
      See Also:
    • DEFAULT_CLIENT_QUEUE_SIZE

      public static final int DEFAULT_CLIENT_QUEUE_SIZE
      Default queue size used for each client
      See Also:
  • Constructor Details

    • AbstractServerSocketAppender

      public AbstractServerSocketAppender()
  • Method Details

    • start

      public void start()
      Specified by:
      start in interface LifeCycle
      Overrides:
      start in class AppenderBase<E>
    • 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

      public void stop()
      Specified by:
      stop in interface LifeCycle
      Overrides:
      stop in class AppenderBase<E>
    • append

      protected void append(E event)
      Specified by:
      append in class AppenderBase<E>
    • postProcessEvent

      protected abstract void postProcessEvent(E event)
      Postprocess an event received via append().
      Parameters:
      event -
    • getPST

      protected abstract PreSerializationTransformer<E> getPST()
      Gets a transformer that will be used to convert a received event to a Serializable form.
      Returns:
    • getServerSocketFactory

      protected ServerSocketFactory getServerSocketFactory() throws Exception
      Gets the factory used to create ServerSocket objects.

      The default implementation delegates to ServerSocketFactory.getDefault(). Subclasses may override to private a different socket factory implementation.

      Returns:
      socket factory.
      Throws:
      Exception
    • getInetAddress

      protected InetAddress getInetAddress() throws UnknownHostException
      Gets the local address for the listener.
      Returns:
      an InetAddress representation of the local address.
      Throws:
      UnknownHostException
    • getPort

      public int getPort()
      Gets the local port for the listener.
      Returns:
      local port
    • setPort

      public void setPort(int port)
      Sets the local port for the listener.
      Parameters:
      port - the local port to set
    • getBacklog

      public int 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

      public void setBacklog(int backlog)
      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

      public String getAddress()
      Gets the local address for the listener.
      Returns:
      a string representation of the local address
    • setAddress

      public void setAddress(String address)
      Sets the local address for the listener.
      Parameters:
      address - a host name or a string representation of an IP address
    • getClientQueueSize

      public int getClientQueueSize()
      Gets the event queue size used for each client connection.
      Returns:
      queue size
    • setClientQueueSize

      public void setClientQueueSize(int clientQueueSize)
      Sets the event queue size used for each client connection.
      Parameters:
      clientQueueSize - the queue size to set