- All Implemented Interfaces:
Timed_component
public abstract class AbstractTimer_monitor extends java.lang.Object implements Timed_component
A
software component may inherit from this abstract class in order to process
(react to) timer events (see:
time_out(long,AbstractState)). In
PauWare, timers are cyclic; They stop on demand only (see:
to_be_killed() or
to_be_killed(AbstractState)).
Compatibility: Java 9.
- Since:
- 1.0
-
Constructor Summary
Constructors Constructor Description AbstractTimer_monitor() -
Method Summary
Modifier and Type Method Description abstract voidtime_out(long delay, AbstractState context)This method is called whendelayis elapsed.abstract voidtime_out_error(State_exception se)This method is called when timer services raise problems.voidto_be_killed()This method amounts to callingto_be_killed(null);.voidto_be_killed(AbstractState context)This method kills the unique timer (if any) associated with thecontextparameter.voidto_be_reset(long delay)This method amounts to callingto_be_reset(null,delay);.voidto_be_reset(AbstractState context, long delay)This method amounts to killing the unique timer (if any) associated with thecontextparameter and next setting up this timer with the newdelayparameter.voidto_be_reset(AbstractState context, java.lang.Long delay)This method is the same asto_be_reset(AbstractState,long); It guarantees compatibility with Java SE 1.4.x.voidto_be_reset(java.lang.Long delay)This method is the same asto_be_reset(long); It guarantees compatibility with Java SE 1.4.x.voidto_be_set(long delay)This method amounts to callingto_be_set(null,delay);.voidto_be_set(AbstractState context, long delay)This method is called by a software component when timer services are required.voidto_be_set(AbstractState context, java.lang.Long delay)This method is the same asto_be_set(AbstractState,long); It guarantees compatibility with Java SE 1.4.x.voidto_be_set(java.lang.Long delay)This method is the same asto_be_set(long); It guarantees compatibility with Java SE 1.4.x.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
AbstractTimer_monitor
public AbstractTimer_monitor()
-
-
Method Details
-
to_be_killed
public void to_be_killed()This method amounts to callingto_be_killed(null);.Killing the unique timer (if any) associated with the
nullcontext, does not lead to killing the other timers. -
to_be_killed
This method kills the unique timer (if any) associated with thecontextparameter.Killing the unique timer (if any) associated with the
contextparameter, does not lead to killing the other timers, including that associated with thenullcontext.- Parameters:
context-
-
to_be_reset
This method amounts to callingto_be_reset(null,delay);.Only one timer may exist at a time which has the
nullcontext.- Parameters:
delay-- Throws:
State_exception
-
to_be_reset
This method is the same asto_be_reset(long); It guarantees compatibility with Java SE 1.4.x.- Parameters:
delay-- Throws:
State_exception
-
to_be_reset
This method amounts to killing the unique timer (if any) associated with thecontextparameter and next setting up this timer with the newdelayparameter.Only one timer may exist at a time having the
contextparameter. If the context does not exist (thenullcontext may be used as parameter), no exception is raised.- Parameters:
context-delay-- Throws:
State_exception- An encapsulation of a possible exception raised by theTimerorTimerTaskclasses- See Also:
to_be_killed(AbstractState),to_be_set(AbstractState,long)
-
to_be_reset
This method is the same asto_be_reset(AbstractState,long); It guarantees compatibility with Java SE 1.4.x.- Parameters:
context-delay-- Throws:
State_exception
-
to_be_set
This method amounts to callingto_be_set(null,delay);.- Parameters:
delay-- Throws:
State_exception
-
to_be_set
This method is the same asto_be_set(long); It guarantees compatibility with Java SE 1.4.x.- Parameters:
delay-- Throws:
State_exception
-
to_be_set
This method is called by a software component when timer services are required.The
contextparameter may benull. In any case, calling this method while a timer is already assigned to thecontextparameter has no effect; So, useto_be_reset(AbstractState,long)instead. Otherwise (in case of success), a software component will therefore receive, cyclically, a time-out event each time, thedelayparameter is elapsed.- Parameters:
context-delay-- Throws:
State_exception- See Also:
time_out(long,AbstractState)
-
to_be_set
This method is the same asto_be_set(AbstractState,long); It guarantees compatibility with Java SE 1.4.x.- Parameters:
context-delay-- Throws:
State_exception
-
time_out
Description copied from interface:Timed_componentThis method is called whendelayis 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_machinefield in the component isAbstractStateMachine.- Specified by:
time_outin interfaceTimed_component- Throws:
State_exception- An encapsulation of a possible exception raised by theAbstractStateMachine.fires(String,AbstractState,AbstractState,Object,String,Object[],Object,String,Object[],byte)orAbstractStateMachine.run_to_completion(String,boolean)methods
-
time_out_error
Description copied from interface:Timed_componentThis 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 (
separameter). The content of this method may be left empty. The requested timer services that are causing problems are indeed automatically canceled.- Specified by:
time_out_errorin interfaceTimed_component- Throws:
State_exception- Having this exception type in the signature allows the use of methods themselves raising such an exception type
-