Package org.apache.log4j.net
Class UDPReceiver
java.lang.Object
org.apache.log4j.spi.ComponentBase
org.apache.log4j.plugins.PluginSkeleton
org.apache.log4j.plugins.Receiver
org.apache.log4j.net.UDPReceiver
- All Implemented Interfaces:
NetworkBased,PortBased,Pauseable,Plugin,Component,org.apache.log4j.spi.OptionHandler,Thresholdable
Receive LoggingEvents encoded with an XMLLayout, convert the XML data to a
LoggingEvent and post the LoggingEvent.
-
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 org.apache.log4j.plugins.Receiver
thresholdLevelFields inherited from class org.apache.log4j.plugins.PluginSkeleton
active, nameFields inherited from class org.apache.log4j.spi.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 org.apache.log4j.plugins.Receiver
doPost, getThreshold, isAsSevereAsThreshold, setThresholdMethods inherited from class org.apache.log4j.plugins.PluginSkeleton
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getLoggerRepository, getName, isActive, isEquivalent, removePropertyChangeListener, removePropertyChangeListener, setLoggerRepository, setNameMethods inherited from class org.apache.log4j.spi.ComponentBase
getLogger, getNonFloodingLogger, resetErrorCountMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.log4j.net.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
The MulticastDNS zone advertised by a UDPReceiver- See Also:
-
-
Constructor Details
-
UDPReceiver
public UDPReceiver()
-
-
Method Details
-
getPort
public int getPort()Description copied from interface:PortBasedReturns the Port # that this net based thing is using. -
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
public boolean isPaused()Description copied from interface:PauseableGet paused state. -
setPaused
public void setPaused(boolean b) Description copied from interface:PauseableSet paused state. -
setAdvertiseViaMulticastDNS
public void setAdvertiseViaMulticastDNS(boolean advertiseViaMulticastDNS) -
isAdvertiseViaMulticastDNS
public boolean isAdvertiseViaMulticastDNS() -
shutdown
public void shutdown()Description copied from interface:PluginCall when the plugin should be stopped. -
activateOptions
public void activateOptions()Returns true if this receiver is active.- Specified by:
activateOptionsin interfaceorg.apache.log4j.spi.OptionHandler
-