Class PoisonFilter

java.lang.Object
org.jcsp.util.filter.PoisonFilter
All Implemented Interfaces:
Filter

public class PoisonFilter extends 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 Details

    • message

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

      private static String defaultMessage
      Default message.
  • Constructor Details

    • PoisonFilter

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

      public PoisonFilter(String message)
      Constructs a new filter with a specific message.
  • Method Details

    • filter

      public Object filter(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.