Class UDPReceiver

All Implemented Interfaces:
NetworkBased, PortBased, Pauseable, Plugin, Component, org.apache.log4j.spi.OptionHandler, Thresholdable

public class UDPReceiver extends Receiver implements PortBased, Pauseable
Receive LoggingEvents encoded with an XMLLayout, convert the XML data to a LoggingEvent and post the LoggingEvent.
Author:
Scott Deboy <sdeboy@apache.org>
  • Field Details

    • paused

      protected boolean paused
    • ZONE

      public static final String 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: PortBased
      Returns the Port # that this net based thing is using.
      Specified by:
      getPort in interface PortBased
      Returns:
      int port number
    • setPort

      public void setPort(int port)
    • setEncoding

      public void setEncoding(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 String getEncoding()
      Returns value of the Encoding option.
    • getDecoder

      public String getDecoder()
    • setDecoder

      public void setDecoder(String decoder)
    • isPaused

      public boolean isPaused()
      Description copied from interface: Pauseable
      Get paused state.
      Specified by:
      isPaused in interface Pauseable
      Returns:
      paused state.
    • setPaused

      public void setPaused(boolean b)
      Description copied from interface: Pauseable
      Set paused state.
      Specified by:
      setPaused in interface Pauseable
      Parameters:
      b - new value
    • setAdvertiseViaMulticastDNS

      public void setAdvertiseViaMulticastDNS(boolean advertiseViaMulticastDNS)
    • isAdvertiseViaMulticastDNS

      public boolean isAdvertiseViaMulticastDNS()
    • shutdown

      public void shutdown()
      Description copied from interface: Plugin
      Call when the plugin should be stopped.
      Specified by:
      shutdown in interface Plugin
    • activateOptions

      public void activateOptions()
      Returns true if this receiver is active.
      Specified by:
      activateOptions in interface org.apache.log4j.spi.OptionHandler