Class GuardedMethodInvokerImpl
java.lang.Object
org.hawaiiframework.util.semaphore.GuardedMethodInvokerImpl
- All Implemented Interfaces:
GuardedMethodInvoker
Default implementation of
GuardedMethodInvoker
.-
Constructor Summary
ConstructorDescriptionThe constructor.GuardedMethodInvokerImpl
(Semaphore semaphore) Constructor an instance with a given semaphore. -
Method Summary
Modifier and TypeMethodDescriptionboolean
invokeIfNotActive
(Invocable invocation) Invoke the invocation if it's not active.
-
Constructor Details
-
GuardedMethodInvokerImpl
public GuardedMethodInvokerImpl()The constructor. -
GuardedMethodInvokerImpl
Constructor an instance with a given semaphore.
-
-
Method Details
-
invokeIfNotActive
Description copied from interface:GuardedMethodInvoker
Invoke the invocation if it's not active.- Specified by:
invokeIfNotActive
in interfaceGuardedMethodInvoker
- Parameters:
invocation
- The method to invoke.- Returns:
true
if the invocation was attempted,false
if another invocation was active.
-