Class LockableServiceSupport

  • All Implemented Interfaces:
    BrokerServiceAware, Lockable, org.apache.activemq.Service

    public abstract class LockableServiceSupport
    extends org.apache.activemq.util.ServiceSupport
    implements Lockable, BrokerServiceAware
    Helper class for working with services that requires locking
    • Constructor Detail

      • LockableServiceSupport

        public LockableServiceSupport()
    • Method Detail

      • init

        public abstract void init()
                           throws Exception
        Initialize resources before locking
        Throws:
        Exception
      • setUseLock

        public void setUseLock​(boolean useLock)
        Description copied from interface: Lockable
        Turn locking on/off on the resource
        Specified by:
        setUseLock in interface Lockable
      • isUseLock

        public boolean isUseLock()
      • setStopOnError

        public void setStopOnError​(boolean stopOnError)
        Description copied from interface: Lockable
        Stop the broker if the locker get an exception while processing lock.
        Specified by:
        setStopOnError in interface Lockable
      • isStopOnError

        public boolean isStopOnError()
      • preStart

        public void preStart()
                      throws Exception
        Overrides:
        preStart in class org.apache.activemq.util.ServiceSupport
        Throws:
        Exception
      • postStop

        public void postStop​(org.apache.activemq.util.ServiceStopper stopper)
                      throws Exception
        Overrides:
        postStop in class org.apache.activemq.util.ServiceSupport
        Throws:
        Exception
      • keepLockAlive

        protected void keepLockAlive()
      • stopBroker

        protected void stopBroker()