public abstract class LockableServiceSupport extends org.apache.activemq.util.ServiceSupport implements Lockable, BrokerServiceAware
| Modifier and Type | Field and Description |
|---|---|
protected BrokerService |
brokerService |
protected ScheduledThreadPoolExecutor |
clockDaemon |
| Constructor and Description |
|---|
LockableServiceSupport() |
| Modifier and Type | Method and Description |
|---|---|
BrokerService |
getBrokerService() |
Locker |
getLocker() |
long |
getLockKeepAlivePeriod() |
ScheduledThreadPoolExecutor |
getScheduledThreadPoolExecutor() |
abstract void |
init()
Initialize resources before locking
|
boolean |
isStopOnError() |
boolean |
isUseLock() |
protected void |
keepLockAlive() |
void |
postStop(org.apache.activemq.util.ServiceStopper stopper) |
void |
preStart() |
void |
setBrokerService(BrokerService brokerService) |
void |
setLocker(Locker locker)
Set locker to be used
|
void |
setLockKeepAlivePeriod(long lockKeepAlivePeriod)
Period (in milliseconds) on which
Locker.keepAlive() should be checked |
void |
setScheduledThreadPoolExecutor(ScheduledThreadPoolExecutor clockDaemon) |
void |
setStopOnError(boolean stopOnError)
Stop the broker if the locker get an exception while processing lock.
|
void |
setUseLock(boolean useLock)
Turn locking on/off on the resource
|
protected void |
stopBroker() |
addServiceListener, dispose, doStart, doStop, isStarted, isStopped, isStopping, removeServiceListener, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateDefaultLockerprotected ScheduledThreadPoolExecutor clockDaemon
protected BrokerService brokerService
public LockableServiceSupport()
public abstract void init() throws Exception
Exceptionpublic void setUseLock(boolean useLock)
LockablesetUseLock in interface Lockablepublic boolean isUseLock()
public void setStopOnError(boolean stopOnError)
LockablesetStopOnError in interface Lockablepublic boolean isStopOnError()
public void setLocker(Locker locker) throws IOException
LockablesetLocker in interface LockableIOExceptionpublic Locker getLocker() throws IOException
IOExceptionpublic void setLockKeepAlivePeriod(long lockKeepAlivePeriod)
LockableLocker.keepAlive() should be checkedsetLockKeepAlivePeriod in interface Lockablepublic long getLockKeepAlivePeriod()
getLockKeepAlivePeriod in interface Lockablepublic void preStart() throws Exception
preStart in class org.apache.activemq.util.ServiceSupportExceptionpublic void postStop(org.apache.activemq.util.ServiceStopper stopper) throws Exception
postStop in class org.apache.activemq.util.ServiceSupportExceptionprotected void keepLockAlive()
protected void stopBroker()
public ScheduledThreadPoolExecutor getScheduledThreadPoolExecutor()
public void setScheduledThreadPoolExecutor(ScheduledThreadPoolExecutor clockDaemon)
public void setBrokerService(BrokerService brokerService)
setBrokerService in interface BrokerServiceAwarepublic BrokerService getBrokerService()
Copyright © 2005–2020 The Apache Software Foundation. All rights reserved.