Module PauWareTwo

Interface Timed_component

All Known Implementing Classes:
AbstractTimer_monitor

public interface Timed_component
This interface is a utility that can be implemented by a software component which wants to have timer services at its disposal. However, inheriting from AbstractTimer_monitor is preferable because this class provides a default implementation.

Compatibility: Java 9.

Since:
1.0
  • Method Summary

    Modifier and Type Method Description
    void time_out​(long delay, AbstractState context)
    This method is called when delay is elapsed.
    void time_out_error​(State_exception se)
    This method is called when timer services raise problems.
  • Method Details

    • time_out

      void time_out​(long delay, AbstractState context) throws State_exception
      This method is called when delay is elapsed.

      A software component receiving a time-out may check the delay and/or the context in which, it asks for timer services. Normally, the content of this method starts with several transitions (see the AbstractStateMachine.fires(String,AbstractState,AbstractState,Object,String,Object[],Object,String,Object[],byte) method) and ends with a run-to-completion cycle, namely _my_state_machine.run_to_completion("time_out"); where the type of the _my_state_machine field in the component is AbstractStateMachine.

      Parameters:
      delay -
      context -
      Throws:
      State_exception
    • time_out_error

      void time_out_error​(State_exception se) throws State_exception
      This method is called when timer services raise problems.

      A software component receiving a time-out error may know the reason why the requested timer services fail (se parameter). The content of this method may be left empty. The requested timer services that are causing problems are indeed automatically canceled.

      Parameters:
      se -
      Throws:
      State_exception