Top Description Fields Constructors Methods
ch.qos.logback.classic.net.server

public Class ServerSocketReceiver

extends ReceiverBase
Class Inheritance
Known Direct Subclasses
ch.qos.logback.classic.net.server.SSLServerSocketReceiver
Imports
java.io.IOException, java.net.InetAddress, .ServerSocket, .UnknownHostException, java.util.concurrent.Executor, javax.net.ServerSocketFactory, ch.qos.logback.classic.net.ReceiverBase, ch.qos.logback.core.net.AbstractSocketAppender, ch.qos.logback.core.net.server.ServerListener, .ServerRunner, ch.qos.logback.core.util.CloseUtil

A logging socket server that is configurable using Joran.
Author
Carl Harris

Field Summary

Modifier and TypeField and Description
private String
private int
public static final int
private int
private ServerRunner<T extends Client>
private ServerSocket

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected ServerListener<RemoteAppenderClient>
protected ServerRunner<T extends Client>
public String

Returns:

a string representation of the local address
getAddress
()

Gets the local address for the listener.

public int

Returns:

queue depth
getBacklog
()

Gets the listener queue depth.

protected InetAddress

Returns:

an InetAddress representation of the local address.
getInetAddress
()

Gets the local address for the listener.

public int

Returns:

local port
getPort
()

Gets the local port for the listener.

protected Runnable
getRunnableTask()

Implements abstract ch.qos.logback.classic.net.ReceiverBase.getRunnableTask.

Provides the runnable task this receiver will execute.
protected ServerSocketFactory

Returns:

server socket factory
getServerSocketFactory
()

Gets the server socket factory.

protected void
onStop()

Implements abstract ch.qos.logback.classic.net.ReceiverBase.onStop.

Allows a subclass to participate in receiver shutdown.
public void
setAddress(String
a host name or a string representation of an IP address
address
)

Sets the local address for the listener.

public void
setBacklog(int
the queue depth to set
backlog
)

Sets the listener queue depth.

public void
setPort(int
the local port to set
port
)

Sets the local port for the listener.

protected boolean
shouldStart()

Implements abstract ch.qos.logback.classic.net.ReceiverBase.shouldStart.

Starts the server.
Inherited from ch.qos.logback.classic.net.ReceiverBase:
isStartedstartstop

Field Detail

addressback to summary
private String address
backlogback to summary
private int backlog
DEFAULT_BACKLOGback to summary
public static final int DEFAULT_BACKLOG

Default ServerSocket backlog

portback to summary
private int port
runnerback to summary
private ServerRunner<T extends Client> runner
Annotations
@SuppressWarnings:rawtypes
serverSocketback to summary
private ServerSocket serverSocket

Constructor Detail

ServerSocketReceiverback to summary
public ServerSocketReceiver()

Method Detail

createServerListenerback to summary
protected ServerListener<RemoteAppenderClient> createServerListener(ServerSocket socket)
createServerRunnerback to summary
protected ServerRunner<T extends Client> createServerRunner(ServerListener<RemoteAppenderClient> listener, Executor executor)
Annotations
@SuppressWarnings:rawtypes
getAddressback to summary
public String getAddress()

Gets the local address for the listener.

Returns:String

a string representation of the local address

getBacklogback to summary
public int getBacklog()

Gets the listener queue depth.

This represents the number of connected clients whose connections have not yet been accepted.

Returns:int

queue depth

See Also
java.net.ServerSocket
getInetAddressback to summary
protected InetAddress getInetAddress() throws UnknownHostException

Gets the local address for the listener.

Returns:InetAddress

an InetAddress representation of the local address.

getPortback to summary
public int getPort()

Gets the local port for the listener.

Returns:int

local port

getRunnableTaskback to summary
protected Runnable getRunnableTask()

Implements abstract ch.qos.logback.classic.net.ReceiverBase.getRunnableTask.

Doc from ch.qos.logback.classic.net.ReceiverBase.getRunnableTask.

Provides the runnable task this receiver will execute.

Returns:Runnable

runnable task

Annotations
@Override
getServerSocketFactoryback to summary
protected ServerSocketFactory getServerSocketFactory() throws Exception

Gets the server socket factory.

Subclasses may override to provide a custom factory.

Returns:ServerSocketFactory

server socket factory

onStopback to summary
protected void onStop()

Implements abstract ch.qos.logback.classic.net.ReceiverBase.onStop.

Doc from ch.qos.logback.classic.net.ReceiverBase.onStop.

Allows a subclass to participate in receiver shutdown.

setAddressback to summary
public void setAddress(String address)

Sets the local address for the listener.

Parameters
address:String

a host name or a string representation of an IP address

setBacklogback to summary
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:int

the queue depth to set

See Also
java.net.ServerSocket
setPortback to summary
public void setPort(int port)

Sets the local port for the listener.

Parameters
port:int

the local port to set

shouldStartback to summary
protected boolean shouldStart()

Implements abstract ch.qos.logback.classic.net.ReceiverBase.shouldStart.

Starts the server.

Returns:boolean

Doc from ch.qos.logback.classic.net.ReceiverBase.shouldStart.

flag indicating whether this receiver should start