Package org.jgrapes.core
Class CompletionLock
java.lang.Object
org.jgrapes.core.internal.CompletionLockBase
org.jgrapes.core.CompletionLock
Represents a lock that prevents sending completion events.
Completion locks can be added to events. They have the same effect as an event that has been fired during the execution and that has not been processed yet.
Removing the last completion lock from an event after all events fired by its handlers have been processed will cause the completion events to be fired.
- See Also:
-
Constructor Summary
ConstructorDescriptionCompletionLock
(Event<?> event) Creates a completion lock without timeout.CompletionLock
(Event<?> event, long timeout) Creates a completion lock for the given event with the given timeout. -
Method Summary
Methods inherited from class org.jgrapes.core.internal.CompletionLockBase
remove
-
Constructor Details
-
CompletionLock
Creates a completion lock for the given event with the given timeout.- Parameters:
event
- the event to be lockedtimeout
- the timeout, if zero, the lock will be held up until it is released
-
CompletionLock
Creates a completion lock without timeout.- Parameters:
event
- the event to be locked
-