Class AbstractSocketManager
java.lang.Object
org.apache.logging.log4j.core.appender.AbstractManager
org.apache.logging.log4j.core.appender.OutputStreamManager
org.apache.logging.log4j.core.net.AbstractSocketManager
- All Implemented Interfaces:
AutoCloseable, ByteBufferDestination
- Direct Known Subclasses:
DatagramSocketManager, TcpSocketManager
Abstract base class for managing sockets.
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractManager
AbstractManager.AbstractFactoryData -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StringThe name of the host.protected final InetAddressThe Internet address of the host.protected final intThe port on the host.Fields inherited from class OutputStreamManager
byteBuffer, layoutFields inherited from class AbstractManager
count, LOGGER -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSocketManager(String name, OutputStream os, InetAddress inetAddress, String host, int port, Layout<? extends Serializable> layout, boolean writeHeader, int bufferSize) Constructs a new instance. -
Method Summary
Methods inherited from class OutputStreamManager
closeOutputStream, createOutputStream, drain, flush, flushBuffer, flushDestination, getByteBuffer, getManager, getOutputStream, hasOutputStream, isOpen, releaseSub, setOutputStream, skipFooter, write, write, write, write, writeBytes, writeBytes, writeFooter, writeHeader, writeToDestinationMethods inherited from class AbstractManager
close, getCount, getLoggerContext, getManager, getName, getStrSubstitutor, hasManager, log, logDebug, logError, logger, logWarn, narrow, release, stop, updateData
-
Field Details
-
inetAddress
The Internet address of the host. -
host
The name of the host. -
port
protected final int portThe port on the host.
-
-
Constructor Details
-
AbstractSocketManager
public AbstractSocketManager(String name, OutputStream os, InetAddress inetAddress, String host, int port, Layout<? extends Serializable> layout, boolean writeHeader, int bufferSize) Constructs a new instance.- Parameters:
name- The unique name of this connection.os- The OutputStream to manage.inetAddress- The Internet address.host- The target host name.port- The target port number.bufferSize- The buffer size.
-
-
Method Details
-
getContentFormat
Gets this AbstractSocketManager's content format. Specified by:- Key: "port" Value: provided "port" param
- Key: "address" Value: provided "address" param
- Overrides:
getContentFormatin classAbstractManager- Returns:
- Map of content format keys supporting AbstractSocketManager
-
getHost
-
getPort
public int getPort()Gets the port.- Returns:
- the port.
-