public abstract class SocketAppenderBase<E> extends AppenderBase<E>
Modifier and Type | Field and Description |
---|---|
protected InetAddress |
address |
protected int |
counter |
protected ObjectOutputStream |
oos |
protected int |
port |
protected int |
reconnectionDelay |
protected String |
remoteHost
We remember host name as String in addition to the resolved InetAddress so
that it can be returned via getOption().
|
name, started
context
Constructor and Description |
---|
SocketAppenderBase() |
Modifier and Type | Method and Description |
---|---|
protected void |
append(E event) |
void |
cleanUp()
Drop the connection to the remote host and release the underlying connector
thread if it has been created
|
protected static InetAddress |
getAddressByName(String host) |
int |
getPort()
Returns value of the Port property.
|
protected abstract PreSerializationTransformer<E> |
getPST() |
int |
getReconnectionDelay()
Returns value of the reconnectionDelay property.
|
String |
getRemoteHost()
Returns value of the RemoteHost property.
|
protected abstract void |
postProcessEvent(E event) |
void |
setPort(int port)
The Port property takes a positive integer representing the port
where the server is waiting for connections.
|
void |
setReconnectionDelay(int delay)
The reconnectionDelay property takes a positive integer representing
the number of milliseconds to wait between each failed connection attempt
to the server.
|
void |
setRemoteHost(String host)
The RemoteHost property takes the name of of the host where a corresponding server is running.
|
void |
start()
Start this appender.
|
void |
stop()
Strop this appender.
|
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
protected String remoteHost
protected InetAddress address
protected int port
protected ObjectOutputStream oos
protected int reconnectionDelay
protected int counter
public void start()
start
in interface LifeCycle
start
in class AppenderBase<E>
public void stop()
This will mark the appender as closed and call then cleanUp()
method.
stop
in interface LifeCycle
stop
in class AppenderBase<E>
public void cleanUp()
protected void append(E event)
append
in class AppenderBase<E>
protected abstract void postProcessEvent(E event)
protected abstract PreSerializationTransformer<E> getPST()
protected static InetAddress getAddressByName(String host)
public void setRemoteHost(String host)
public String getRemoteHost()
public void setPort(int port)
public int getPort()
public void setReconnectionDelay(int delay)
Setting this option to zero turns off reconnection capability.
public int getReconnectionDelay()
Copyright © 2005-2013 QOS.ch. All Rights Reserved.