Class MulticastReceiver
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.MulticastReceiver
- All Implemented Interfaces:
Pauseable, Plugin, Component, Thresholdable, AddressBased, NetworkBased, PortBased, org.apache.log4j.spi.OptionHandler
Multicast-based receiver. Accepts LoggingEvents encoded using
MulticastAppender and XMLLayout. The the XML data is converted
back to a LoggingEvent and is posted.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class(package private) class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate booleanprivate Stringprivate Decoderprivate Stringprivate static final intprivate booleanprivate intprivate MulticastSocketprivate org.apache.log4j.net.ZeroConfSupportstatic final StringThe MulticastDNS zone advertised by a MulticastReceiverFields inherited from class Receiver
thresholdLevelFields inherited from class PluginSkeleton
active, nameFields inherited from class ComponentBase
repository -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidReturns a String representation of the Address this instance encompasses.Returns value of the Encoding option.intgetPort()Returns the Port # that this net based thing is using.booleanbooleanisPaused()Get paused state.voidsetAddress(String address) 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:
-
port
private int port -
address
-
encoding
-
socket
-
decoder
-
decoderImpl
-
handlerThread
-
receiverThread
-
paused
private boolean paused -
advertiseViaMulticastDNS
private boolean advertiseViaMulticastDNS -
zeroConf
private org.apache.log4j.net.ZeroConfSupport zeroConf -
ZONE
-
-
Constructor Details
-
MulticastReceiver
public MulticastReceiver()
-
-
Method Details
-
getDecoder
-
setDecoder
-
getPort
-
setPort
public void setPort(int port) -
getAddress
Description copied from interface:AddressBasedReturns a String representation of the Address this instance encompasses.- Specified by:
getAddressin interfaceAddressBased- Returns:
- String representation of the Address
-
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. -
shutdown
-
setAddress
-
isPaused
-
setPaused
-
activateOptions
public void activateOptions()- Specified by:
activateOptionsin interfaceorg.apache.log4j.spi.OptionHandler
-
setAdvertiseViaMulticastDNS
public void setAdvertiseViaMulticastDNS(boolean advertiseViaMulticastDNS) -
isAdvertiseViaMulticastDNS
public boolean isAdvertiseViaMulticastDNS()
-