Package org.jgrapes.core.internal
Class GeneratorRegistry
java.lang.Object
org.jgrapes.core.internal.GeneratorRegistry
A registry for generators.
Used to track generators and determine whether the application has stopped.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a generator.voidAwait exhaustion.booleanawaitExhaustion(long timeout) Await exhaustion with a timeout.static GeneratorRegistryinstance()Returns the singleton instance of the registry.booleanChecks if is exhausted (no generators left)voidRemoves the generator.
-
Method Details
-
instance
Returns the singleton instance of the registry.- Returns:
- the generator registry
-
add
Adds a generator.- Parameters:
obj- the obj
-
remove
Removes the generator.- Parameters:
obj- the generator
-
isExhausted
Checks if is exhausted (no generators left)- Returns:
- true, if is exhausted
-
awaitExhaustion
Await exhaustion.- Throws:
InterruptedException- the interrupted exception
-
awaitExhaustion
Await exhaustion with a timeout.- Parameters:
timeout- the timeout- Returns:
- true, if successful
- Throws:
InterruptedException- the interrupted exception
-