Package me.hsgamer.topper.agent.runnable
Class RunnableAgent<K,V,A extends Agent<K,V> & Runnable>
- java.lang.Object
-
- me.hsgamer.topper.agent.runnable.RunnableAgent<K,V,A>
-
-
Constructor Summary
Constructors Constructor Description RunnableAgent(A agent)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
beforeStop()
A
getAgent()
void
onCreate(DataEntry<K,V> entry)
void
onRemove(DataEntry<K,V> entry)
void
onUnregister(DataEntry<K,V> entry)
void
onUpdate(DataEntry<K,V> entry)
protected abstract Runnable
run(Runnable runnable)
This method is used to run the task and return aRunnable
to cancel itvoid
start()
void
stop()
-
-
-
Constructor Detail
-
RunnableAgent
public RunnableAgent(A agent)
-
-
Method Detail
-
run
protected abstract Runnable run(Runnable runnable)
This method is used to run the task and return aRunnable
to cancel it- Parameters:
runnable
- the task to run- Returns:
- the
Runnable
to cancel the task
-
beforeStop
public void beforeStop()
- Specified by:
beforeStop
in interfaceAgent<K,V>
-
onUnregister
public void onUnregister(DataEntry<K,V> entry)
- Specified by:
onUnregister
in interfaceAgent<K,V>
-
getAgent
public A getAgent()
-
-