public class TimeTriggerPolicy<T> extends java.lang.Object implements TriggerPolicy<T,java.lang.Void>
TriggerHandler.onTrigger()
after the duration.Constructor and Description |
---|
TimeTriggerPolicy(long millis,
TriggerHandler handler) |
TimeTriggerPolicy(long millis,
TriggerHandler handler,
EvictionPolicy<T,?> evictionPolicy) |
Modifier and Type | Method and Description |
---|---|
java.lang.Void |
getState()
Return runtime state to be checkpointed by the framework for restoring the trigger
policy in case of failures.
|
void |
reset()
resets the trigger policy.
|
void |
restoreState(java.lang.Void state)
Restore the trigger policy from the state that was earlier checkpointed by the framework.
|
void |
shutdown()
Any clean up could be handled here.
|
void |
start()
Starts the trigger policy.
|
java.lang.String |
toString() |
void |
track(Event<T> event)
Tracks the event and could use this to invoke the trigger.
|
public TimeTriggerPolicy(long millis, TriggerHandler handler)
public TimeTriggerPolicy(long millis, TriggerHandler handler, EvictionPolicy<T,?> evictionPolicy)
public void track(Event<T> event)
TriggerPolicy
track
in interface TriggerPolicy<T,java.lang.Void>
event
- the input eventpublic void reset()
TriggerPolicy
reset
in interface TriggerPolicy<T,java.lang.Void>
public void start()
TriggerPolicy
start
in interface TriggerPolicy<T,java.lang.Void>
public void shutdown()
TriggerPolicy
shutdown
in interface TriggerPolicy<T,java.lang.Void>
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Void getState()
TriggerPolicy
getState
in interface TriggerPolicy<T,java.lang.Void>
public void restoreState(java.lang.Void state)
TriggerPolicy
restoreState
in interface TriggerPolicy<T,java.lang.Void>
state
- the state