Class PoisonFilter

  • All Implemented Interfaces:
    Filter

    public class PoisonFilter
    extends java.lang.Object
    implements Filter
    This filter will throw a PoisonException when filter(Object) is called. This can be used to prevent a channel from being written to or read from.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String defaultMessage
      Default message.
      private java.lang.String message
      The message to be placed in the PoisonException raised.
    • Constructor Summary

      Constructors 
      Constructor Description
      PoisonFilter()
      Constructs a new filter with the default message.
      PoisonFilter​(java.lang.String message)
      Constructs a new filter with a specific message.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object filter​(java.lang.Object obj)
      Applies the filter operation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • message

        private java.lang.String message
        The message to be placed in the PoisonException raised.
      • defaultMessage

        private static java.lang.String defaultMessage
        Default message.
    • Constructor Detail

      • PoisonFilter

        public PoisonFilter()
        Constructs a new filter with the default message.
      • PoisonFilter

        public PoisonFilter​(java.lang.String message)
        Constructs a new filter with a specific message.
    • Method Detail

      • filter

        public java.lang.Object filter​(java.lang.Object obj)
        Description copied from interface: Filter
        Applies the filter operation. The object given can be modified and returned or another object substituted in its place.
        Specified by:
        filter in interface Filter
        Parameters:
        obj - the original object in the channel communication.
        Returns:
        the modified/substituted object after filtration.