Package org.apache.log4j.net
Class MulticastReceiver
- java.lang.Object
-
- org.apache.log4j.spi.ComponentBase
-
- org.apache.log4j.plugins.PluginSkeleton
-
- org.apache.log4j.plugins.Receiver
-
- org.apache.log4j.net.MulticastReceiver
-
- All Implemented Interfaces:
AddressBased
,NetworkBased
,PortBased
,Pauseable
,Plugin
,Component
,org.apache.log4j.spi.OptionHandler
,Thresholdable
public class MulticastReceiver extends Receiver implements PortBased, AddressBased, Pauseable
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 Classes Modifier and Type Class Description (package private) class
MulticastReceiver.MulticastHandlerThread
(package private) class
MulticastReceiver.MulticastReceiverThread
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
address
private boolean
advertiseViaMulticastDNS
private java.lang.String
decoder
private Decoder
decoderImpl
private java.lang.String
encoding
private MulticastReceiver.MulticastHandlerThread
handlerThread
private static int
PACKET_LENGTH
private boolean
paused
private int
port
private MulticastReceiver.MulticastReceiverThread
receiverThread
private java.net.MulticastSocket
socket
private org.apache.log4j.net.ZeroConfSupport
zeroConf
static java.lang.String
ZONE
The MulticastDNS zone advertised by a MulticastReceiver-
Fields inherited from class org.apache.log4j.plugins.Receiver
thresholdLevel
-
Fields inherited from class org.apache.log4j.plugins.PluginSkeleton
active, name
-
Fields inherited from class org.apache.log4j.spi.ComponentBase
repository
-
-
Constructor Summary
Constructors Constructor Description MulticastReceiver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activateOptions()
java.lang.String
getAddress()
Returns a String representation of the Address this instance encompasses.java.lang.String
getDecoder()
java.lang.String
getEncoding()
Returns value of the Encoding option.int
getPort()
Returns the Port # that this net based thing is using.boolean
isAdvertiseViaMulticastDNS()
boolean
isPaused()
Get paused state.void
setAddress(java.lang.String address)
void
setAdvertiseViaMulticastDNS(boolean advertiseViaMulticastDNS)
void
setDecoder(java.lang.String decoder)
void
setEncoding(java.lang.String encoding)
The Encoding option specifies how the bytes are encoded.void
setPaused(boolean b)
Set paused state.void
setPort(int port)
void
shutdown()
Call when the plugin should be stopped.-
Methods inherited from class org.apache.log4j.plugins.Receiver
doPost, getThreshold, isAsSevereAsThreshold, setThreshold
-
Methods inherited from class org.apache.log4j.plugins.PluginSkeleton
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getLoggerRepository, getName, isActive, isEquivalent, removePropertyChangeListener, removePropertyChangeListener, setLoggerRepository, setName
-
Methods inherited from class org.apache.log4j.spi.ComponentBase
getLogger, getNonFloodingLogger, resetErrorCount
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.log4j.net.NetworkBased
getName, isActive
-
-
-
-
Field Detail
-
PACKET_LENGTH
private static final int PACKET_LENGTH
- See Also:
- Constant Field Values
-
port
private int port
-
address
private java.lang.String address
-
encoding
private java.lang.String encoding
-
socket
private java.net.MulticastSocket socket
-
decoder
private java.lang.String decoder
-
decoderImpl
private Decoder decoderImpl
-
handlerThread
private MulticastReceiver.MulticastHandlerThread handlerThread
-
receiverThread
private MulticastReceiver.MulticastReceiverThread receiverThread
-
paused
private boolean paused
-
advertiseViaMulticastDNS
private boolean advertiseViaMulticastDNS
-
zeroConf
private org.apache.log4j.net.ZeroConfSupport zeroConf
-
ZONE
public static final java.lang.String ZONE
The MulticastDNS zone advertised by a MulticastReceiver- See Also:
- Constant Field Values
-
-
Method Detail
-
getDecoder
public java.lang.String getDecoder()
-
setDecoder
public void setDecoder(java.lang.String decoder)
-
getPort
public int getPort()
Description copied from interface:PortBased
Returns the Port # that this net based thing is using.
-
setPort
public void setPort(int port)
-
getAddress
public java.lang.String getAddress()
Description copied from interface:AddressBased
Returns a String representation of the Address this instance encompasses.- Specified by:
getAddress
in interfaceAddressBased
- Returns:
- String representation of the Address
-
setEncoding
public void setEncoding(java.lang.String encoding)
The Encoding option specifies how the bytes are encoded. If this option is not specified, the system encoding will be used.
-
getEncoding
public java.lang.String getEncoding()
Returns value of the Encoding option.
-
shutdown
public void shutdown()
Description copied from interface:Plugin
Call when the plugin should be stopped.
-
setAddress
public void setAddress(java.lang.String address)
-
isPaused
public boolean isPaused()
Description copied from interface:Pauseable
Get paused state.
-
setPaused
public void setPaused(boolean b)
Description copied from interface:Pauseable
Set paused state.
-
activateOptions
public void activateOptions()
- Specified by:
activateOptions
in interfaceorg.apache.log4j.spi.OptionHandler
-
setAdvertiseViaMulticastDNS
public void setAdvertiseViaMulticastDNS(boolean advertiseViaMulticastDNS)
-
isAdvertiseViaMulticastDNS
public boolean isAdvertiseViaMulticastDNS()
-
-