Package org.wildfly.clustering.ee
Interface Scheduler<I,M>
-
- All Superinterfaces:
AutoCloseable
public interface Scheduler<I,M> extends AutoCloseable
A task scheduler.- Author:
- Paul Ferraro
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidcancel(I id)Cancels a previously scheduled task for the object with the specified identifier.voidclose()Closes any resources used by this scheduler.default booleancontains(I id)Indicates whether the object with the specified identifier is scheduled.voidschedule(I id, M metaData)Schedules a task for the object with the specified identifier, using the specified metaDataStream<I>stream()Returns a stream of scheduled item identifiers.
-
-
-
Method Detail
-
schedule
void schedule(I id, M metaData)
Schedules a task for the object with the specified identifier, using the specified metaData- Parameters:
id- an object identifiermetaData- the object meta-data
-
cancel
void cancel(I id)
Cancels a previously scheduled task for the object with the specified identifier.- Parameters:
id- an object identifier
-
stream
Stream<I> stream()
Returns a stream of scheduled item identifiers.- Returns:
- a stream of scheduled item identifiers.
-
contains
default boolean contains(I id)
Indicates whether the object with the specified identifier is scheduled.- Parameters:
id- an object identifier
-
close
void close()
Closes any resources used by this scheduler.- Specified by:
closein interfaceAutoCloseable
-
-