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
public abstract class AbstractSocketManager extends OutputStreamManager
Abstract base class for managing sockets.
-
-
Field Summary
Fields Modifier and Type Field Description protected String
host
The name of the host.protected InetAddress
inetAddress
The Internet address of the host.protected int
port
The port on the host.-
Fields inherited from class org.apache.logging.log4j.core.appender.OutputStreamManager
byteBuffer, layout
-
Fields inherited from class org.apache.logging.log4j.core.appender.AbstractManager
count, LOGGER
-
-
Constructor Summary
Constructors Constructor Description AbstractSocketManager(String name, OutputStream os, InetAddress inetAddress, String host, int port, Layout<? extends Serializable> layout, boolean writeHeader, int bufferSize)
The Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>
getContentFormat()
Gets this AbstractSocketManager's content format.-
Methods inherited from class org.apache.logging.log4j.core.appender.OutputStreamManager
closeOutputStream, createOutputStream, drain, flush, flushBuffer, flushDestination, getByteBuffer, getManager, getOutputStream, hasOutputStream, isOpen, releaseSub, setOutputStream, skipFooter, write, write, write, write, writeBytes, writeBytes, writeFooter, writeToDestination
-
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractManager
close, getCount, getLoggerContext, getManager, getName, hasManager, log, logDebug, logError, logger, logWarn, narrow, release, stop, updateData
-
-
-
-
Field Detail
-
inetAddress
protected final InetAddress inetAddress
The Internet address of the host.
-
host
protected final String host
The name of the host.
-
port
protected final int port
The port on the host.
-
-
Constructor Detail
-
AbstractSocketManager
public AbstractSocketManager(String name, OutputStream os, InetAddress inetAddress, String host, int port, Layout<? extends Serializable> layout, boolean writeHeader, int bufferSize)
The Constructor.- 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 Detail
-
getContentFormat
public Map<String,String> getContentFormat()
Gets this AbstractSocketManager's content format. Specified by:- Key: "port" Value: provided "port" param
- Key: "address" Value: provided "address" param
- Overrides:
getContentFormat
in classAbstractManager
- Returns:
- Map of content format keys supporting AbstractSocketManager
-
-