Package nl.vpro.util.locker
Interface ObjectLocker.Listener
-
- All Superinterfaces:
EventListener
- Enclosing class:
- ObjectLocker
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public static interface ObjectLocker.Listener extends EventListener
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ObjectLocker.Listener.Type
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
event(ObjectLocker.Listener.Type type, ObjectLocker.LockHolder<?> holder, Duration duration)
Called for lock eventdefault void
lock(ObjectLocker.LockHolder<?> lock, Duration duration)
default void
unlock(ObjectLocker.LockHolder<?> lock, Duration duration)
-
-
-
Method Detail
-
event
void event(ObjectLocker.Listener.Type type, ObjectLocker.LockHolder<?> holder, Duration duration)
Called for lock event- Parameters:
type
- What happens to the lock (lock, or unlock)holder
- The relevantObjectLocker.LockHolder
duration
- How long it took to obtain/release this lock
-
lock
default void lock(ObjectLocker.LockHolder<?> lock, Duration duration)
-
unlock
default void unlock(ObjectLocker.LockHolder<?> lock, Duration duration)
-
-