- java.lang.Object
-
- aeonics.entity.Entity
-
- aeonics.manager.Manager.Type
-
- aeonics.manager.Timeout
-
- All Implemented Interfaces:
Exportable
,Snapshotable
public abstract class Timeout extends Manager.Type
This manager is keeping track of elements that expire or should be triggered after a specified amount of time. An element can only be triggered once and then it is removed from the watch list. In behavior, this is similar toScheduler.in(java.util.function.Consumer, long)
but the intent is not the same.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Timeout.Tracker<T>
This class englobes a target object to track and defines aTimeout.Tracker.delay()
.
-
Constructor Summary
Constructors Constructor Description Timeout()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Class<? extends Manager.Type>
manager()
Hardcoded manager typeabstract void
refresh()
This method will re-inspect allTimeout.Tracker
in the watch list to determine if some elements have expired.abstract <T> void
remove(Timeout.Tracker<T> tracker)
Removes the specified tracker from the watch list.abstract <T> void
watch(Timeout.Tracker<T> tracker)
Adds the specified tracker to the watch list.-
Methods inherited from class aeonics.manager.Manager.Type
category, internal
-
Methods inherited from class aeonics.entity.Entity
addRelation, addRelation, addRelation, cast, clearRelation, config, defineRelation, equals, export, firstRelation, hashCode, hasRelation, id, name, name, onCreate, onRemove, onUpdate, parameter, relations, relationships, removeRelation, snapshot, type, valueOf, valueOf
-
-
-
-
Method Detail
-
manager
public final java.lang.Class<? extends Manager.Type> manager()
Hardcoded manager type- Specified by:
manager
in classManager.Type
- Returns:
- the type of manager
-
watch
public abstract <T> void watch(Timeout.Tracker<T> tracker)
Adds the specified tracker to the watch list.- Type Parameters:
T
- the tracked element type- Parameters:
tracker
- the tracker
-
remove
public abstract <T> void remove(Timeout.Tracker<T> tracker)
Removes the specified tracker from the watch list.- Type Parameters:
T
- the tracked element type- Parameters:
tracker
- the tracker
-
refresh
public abstract void refresh()
This method will re-inspect allTimeout.Tracker
in the watch list to determine if some elements have expired. You should not need to call this method unless in some specific circumstances.
-
-