Package jadex.bridge

Class CheckedAction

  • All Implemented Interfaces:
    java.lang.Runnable

    public abstract class CheckedAction
    extends java.lang.Object
    implements java.lang.Runnable
    Can be used as external action, which will only be executed when isValid() is true. Further, it is guaranteed that cleanup() will be executed. Contract is: if(isValid()) run(); cleanup();
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean valid
      The valid flag.
    • Constructor Summary

      Constructors 
      Constructor Description
      CheckedAction()
      Create a new action.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cleanup()
      Cleanup will be executed at the end of the action.
      boolean isValid()
      Test if the timed object is valid.
      void setValid​(boolean valid)
      Set the valid state.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Runnable

        run
    • Field Detail

      • valid

        protected boolean valid
        The valid flag.
    • Constructor Detail

      • CheckedAction

        public CheckedAction()
        Create a new action.
    • Method Detail

      • cleanup

        public void cleanup()
        Cleanup will be executed at the end of the action. Override if cleanup actions are necessary.
      • isValid

        public boolean isValid()
        Test if the timed object is valid.
        Returns:
        True, if entry is valid.
      • setValid

        public void setValid​(boolean valid)
        Set the valid state.