org.apache.activemq.broker
Class LockableServiceSupport
java.lang.Object
org.apache.activemq.util.ServiceSupport
org.apache.activemq.broker.LockableServiceSupport
- All Implemented Interfaces:
- BrokerServiceAware, Lockable, Service
public abstract class LockableServiceSupport
- extends ServiceSupport
- implements Lockable, BrokerServiceAware
Helper class for working with services that requires locking
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
brokerService
protected BrokerService brokerService
LockableServiceSupport
public LockableServiceSupport()
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()
setLocker
public void setLocker(Locker locker)
throws IOException
- Description copied from interface:
Lockable
- Set locker to be used
- Specified by:
setLocker in interface Lockable
- Throws:
IOException
getLocker
public Locker getLocker()
throws IOException
- Throws:
IOException
setLockKeepAlivePeriod
public void setLockKeepAlivePeriod(long lockKeepAlivePeriod)
- Description copied from interface:
Lockable
- Period (in milliseconds) on which
Locker.keepAlive() should be checked
- Specified by:
setLockKeepAlivePeriod in interface Lockable
getLockKeepAlivePeriod
public long getLockKeepAlivePeriod()
- Specified by:
getLockKeepAlivePeriod in interface Lockable
preStart
public void preStart()
throws Exception
- Overrides:
preStart in class ServiceSupport
- Throws:
Exception
postStop
public void postStop(ServiceStopper stopper)
throws Exception
- Overrides:
postStop in class ServiceSupport
- Throws:
Exception
keepLockAlive
protected void keepLockAlive()
stopBroker
protected void stopBroker()
getScheduledThreadPoolExecutor
public ScheduledThreadPoolExecutor getScheduledThreadPoolExecutor()
setBrokerService
public void setBrokerService(BrokerService brokerService)
- Specified by:
setBrokerService in interface BrokerServiceAware
getBrokerService
public BrokerService getBrokerService()
Copyright © 2005-2013 The Apache Software Foundation. All Rights Reserved.