- 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 classTimeout.Tracker<T>This class englobes a target object to track and defines aTimeout.Tracker.delay().-
Nested classes/interfaces inherited from interface aeonics.util.Snapshotable
Snapshotable.SnapshotMode
-
-
Constructor Summary
Constructors Constructor Description Timeout()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Timeoutget()Returns the current active instance of this manager type.java.lang.Class<? extends Manager.Type>manager()Hardcoded manager typeabstract voidrefresh()This method will re-inspect allTimeout.Trackerin the watch list to determine if some elements have expired.abstract <T> voidremove(Timeout.Tracker<T> tracker)Removes the specified tracker from the watch list.abstract <T> voidwatch(Timeout.Tracker<T> tracker)Adds the specified tracker to the watch list.-
Methods inherited from class aeonics.manager.Manager.Type
category, internal, snapshotMode
-
Methods inherited from class aeonics.entity.Entity
addRelation, addRelation, addRelation, cast, clearRelation, config, context, countRelations, countRelations, defineRelation, equals, export, firstRelation, hashCode, hasRelation, id, internal, name, name, onCreate, onRemove, onUpdate, parameter, relations, relationships, removeRelation, snapshot, template, type, valueOf, valueOf
-
-
-
-
Method Detail
-
manager
public final java.lang.Class<? extends Manager.Type> manager()
Hardcoded manager type- Specified by:
managerin classManager.Type- Returns:
- the type of manager
-
get
public static Timeout get()
Returns the current active instance of this manager type.- Returns:
- the current active instance of this manager type
-
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.Trackerin the watch list to determine if some elements have expired. You should not need to call this method unless in some specific circumstances.
-
-