Class CompletionLock


public class CompletionLock extends CompletionLockBase
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:
  • EventBase.addCompletionLock(org.jgrapes.core.internal.CompletionLockBase)
  • Constructor Details

    • CompletionLock

      public CompletionLock(Event<?> event, long timeout)
      Creates a completion lock for the given event with the given timeout.
      Parameters:
      event - the event to be locked
      timeout - the timeout, if zero, the lock will be held up until it is released
    • CompletionLock

      public CompletionLock(Event<?> event)
      Creates a completion lock without timeout.
      Parameters:
      event - the event to be locked