Class UDPReceiver
java.lang.Object
org.apache.log4j.component.spi.ComponentBase
org.apache.log4j.component.plugins.PluginSkeleton
org.apache.log4j.component.plugins.Receiver
org.apache.log4j.receivers.net.UDPReceiver
- All Implemented Interfaces:
Pauseable, Plugin, Component, Thresholdable, NetworkBased, PortBased, org.apache.log4j.spi.OptionHandler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class(package private) class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate Stringprivate Decoderprivate String(package private) UDPReceiver.UDPHandlerThreadprivate static final intprotected booleanprivate intprivate UDPReceiver.UDPReceiverThreadprivate DatagramSocketprivate org.apache.log4j.net.ZeroConfSupportstatic final StringThe MulticastDNS zone advertised by a UDPReceiverFields inherited from class Receiver
thresholdLevelFields inherited from class PluginSkeleton
active, nameFields inherited from class ComponentBase
repository -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidReturns true if this receiver is active.Returns value of the Encoding option.intgetPort()Returns the Port # that this net based thing is using.booleanbooleanisPaused()Get paused state.voidsetAdvertiseViaMulticastDNS(boolean advertiseViaMulticastDNS) voidsetDecoder(String decoder) voidsetEncoding(String encoding) The Encoding option specifies how the bytes are encoded.voidsetPaused(boolean b) Set paused state.voidsetPort(int port) voidshutdown()Call when the plugin should be stopped.Methods inherited from class Receiver
doPost, getThreshold, isAsSevereAsThreshold, setThresholdMethods inherited from class PluginSkeleton
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getLoggerRepository, getName, isActive, isEquivalent, removePropertyChangeListener, removePropertyChangeListener, setLoggerRepository, setNameMethods inherited from class ComponentBase
getLogger, getNonFloodingLogger, resetErrorCountMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface NetworkBased
getName, isActive
-
Field Details
-
PACKET_LENGTH
private static final int PACKET_LENGTH- See Also:
-
receiverThread
-
encoding
-
decoder
-
decoderImpl
-
paused
protected boolean paused -
closed
private transient boolean closed -
port
private int port -
socket
-
handlerThread
UDPReceiver.UDPHandlerThread handlerThread -
advertiseViaMulticastDNS
private boolean advertiseViaMulticastDNS -
zeroConf
private org.apache.log4j.net.ZeroConfSupport zeroConf -
ZONE
-
-
Constructor Details
-
UDPReceiver
public UDPReceiver()
-
-
Method Details
-
getPort
-
setPort
public void setPort(int port) -
setEncoding
The Encoding option specifies how the bytes are encoded. If this option is not specified, the system encoding will be used. -
getEncoding
Returns value of the Encoding option. -
getDecoder
-
setDecoder
-
isPaused
-
setPaused
-
setAdvertiseViaMulticastDNS
public void setAdvertiseViaMulticastDNS(boolean advertiseViaMulticastDNS) -
isAdvertiseViaMulticastDNS
public boolean isAdvertiseViaMulticastDNS() -
shutdown
-
activateOptions
public void activateOptions()Returns true if this receiver is active.- Specified by:
activateOptionsin interfaceorg.apache.log4j.spi.OptionHandler
-