- 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 void
time_out(long delay, AbstractState context)
This method is called whendelay
is elapsed.abstract void
time_out_error(State_exception se)
This method is called when timer services raise problems.void
to_be_killed()
This method amounts to callingto_be_killed(null);
.void
to_be_killed(AbstractState context)
This method kills the unique timer (if any) associated with thecontext
parameter.void
to_be_reset(long delay)
This method amounts to callingto_be_reset(null,delay);
.void
to_be_reset(AbstractState context, long delay)
This method amounts to killing the unique timer (if any) associated with thecontext
parameter and next setting up this timer with the newdelay
parameter.void
to_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.void
to_be_reset(java.lang.Long delay)
This method is the same asto_be_reset(long)
; It guarantees compatibility with Java SE 1.4.x.void
to_be_set(long delay)
This method amounts to callingto_be_set(null,delay);
.void
to_be_set(AbstractState context, long delay)
This method is called by a software component when timer services are required.void
to_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.void
to_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
null
context, does not lead to killing the other timers. -
to_be_killed
This method kills the unique timer (if any) associated with thecontext
parameter.Killing the unique timer (if any) associated with the
context
parameter, does not lead to killing the other timers, including that associated with thenull
context.- 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
null
context.- 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 thecontext
parameter and next setting up this timer with the newdelay
parameter.Only one timer may exist at a time having the
context
parameter. If the context does not exist (thenull
context may be used as parameter), no exception is raised.- Parameters:
context
-delay
-- Throws:
State_exception
- An encapsulation of a possible exception raised by theTimer
orTimerTask
classes- 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
context
parameter may benull
. In any case, calling this method while a timer is already assigned to thecontext
parameter 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, thedelay
parameter 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_component
This method is called whendelay
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 isAbstractStateMachine
.- Specified by:
time_out
in 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_component
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.- Specified by:
time_out_error
in interfaceTimed_component
- Throws:
State_exception
- Having this exception type in the signature allows the use of methods themselves raising such an exception type
-