Class DefaultJmsListenerLock
java.lang.Object
org.mule.jms.commons.internal.source.DefaultJmsListenerLock
- All Implemented Interfaces:
JmsListenerLock
Default implementation of
JmsListenerLock based in the usage of Semaphore to support the capability of locking
and unlocking the listener from different threads- Since:
- 1.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecuteOnListenerThread(Runnable runnable) Executes arunnableon the blocked Listener thread.voidinit()Configures the Lock to their initial state.voidlock()Locks the listener waiting to the message to be processed through the flowvoidunlock()Unlocks the listener indicating that message has been processed correctlyvoidUnlocks the listener indicating that message has been processed with failures and the error should be propagatedvoidunlockWithFailure(org.mule.runtime.api.message.Error error) Unlocks the listener indicating that message has been processed with failures and the error should be propagated
-
Constructor Details
-
DefaultJmsListenerLock
public DefaultJmsListenerLock()
-
-
Method Details
-
lock
public void lock()Locks the listener waiting to the message to be processed through the flow- Specified by:
lockin interfaceJmsListenerLock
-
unlockWithFailure
public void unlockWithFailure(org.mule.runtime.api.message.Error error) Unlocks the listener indicating that message has been processed with failures and the error should be propagated- Specified by:
unlockWithFailurein interfaceJmsListenerLock- Parameters:
error- The error to propagate inside the message listener
-
unlockWithFailure
public void unlockWithFailure()Unlocks the listener indicating that message has been processed with failures and the error should be propagated- Specified by:
unlockWithFailurein interfaceJmsListenerLock
-
unlock
public void unlock()Unlocks the listener indicating that message has been processed correctly- Specified by:
unlockin interfaceJmsListenerLock
-
executeOnListenerThread
Executes arunnableon the blocked Listener thread.- Specified by:
executeOnListenerThreadin interfaceJmsListenerLock- Parameters:
runnable- to execute
-
init
public void init()Configures the Lock to their initial state.- Specified by:
initin interfaceJmsListenerLock
-