Class DefaultJmsListenerLock

java.lang.Object
org.mule.jms.commons.internal.source.DefaultJmsListenerLock
All Implemented Interfaces:
JmsListenerLock

public class DefaultJmsListenerLock extends Object implements 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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Executes a runnable on the blocked Listener thread.
    void
    Configures the Lock to their initial state.
    void
    Locks the listener waiting to the message to be processed through the flow
    void
    Unlocks the listener indicating that message has been processed correctly
    void
    Unlocks the listener indicating that message has been processed with failures and the error should be propagated
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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:
      lock in interface JmsListenerLock
    • 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:
      unlockWithFailure in interface JmsListenerLock
      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:
      unlockWithFailure in interface JmsListenerLock
    • unlock

      public void unlock()
      Unlocks the listener indicating that message has been processed correctly
      Specified by:
      unlock in interface JmsListenerLock
    • executeOnListenerThread

      public void executeOnListenerThread(Runnable runnable)
      Executes a runnable on the blocked Listener thread.
      Specified by:
      executeOnListenerThread in interface JmsListenerLock
      Parameters:
      runnable - to execute
    • init

      public void init()
      Configures the Lock to their initial state.
      Specified by:
      init in interface JmsListenerLock