public abstract class LockableServiceSupport extends ServiceSupport implements Lockable, BrokerServiceAware
| Modifier and Type | Field and Description |
|---|---|
protected BrokerService |
brokerService |
| Constructor and Description |
|---|
LockableServiceSupport() |
| Modifier and Type | Method and Description |
|---|---|
BrokerService |
getBrokerService() |
Locker |
getLocker() |
long |
getLockKeepAlivePeriod() |
java.util.concurrent.ScheduledThreadPoolExecutor |
getScheduledThreadPoolExecutor() |
abstract void |
init()
Initialize resources before locking
|
boolean |
isUseLock() |
protected void |
keepLockAlive() |
void |
postStop(ServiceStopper stopper)
handle for various operations after stopping the service (like locking)
|
void |
preStart()
handle for various operations before starting the service (like locking)
|
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 |
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 BrokerService brokerService
public abstract void init()
throws java.lang.Exception
java.lang.Exceptionpublic void setUseLock(boolean useLock)
LockablesetUseLock in interface Lockablepublic boolean isUseLock()
public void setLocker(Locker locker) throws java.io.IOException
Lockablepublic Locker getLocker() throws java.io.IOException
java.io.IOExceptionpublic void setLockKeepAlivePeriod(long lockKeepAlivePeriod)
LockableLocker.keepAlive() should be checkedsetLockKeepAlivePeriod in interface Lockablepublic long getLockKeepAlivePeriod()
getLockKeepAlivePeriod in interface Lockablepublic void preStart()
throws java.lang.Exception
ServiceSupportpreStart in class ServiceSupportjava.lang.Exceptionpublic void postStop(ServiceStopper stopper) throws java.lang.Exception
ServiceSupportpostStop in class ServiceSupportjava.lang.Exceptionprotected void keepLockAlive()
protected void stopBroker()
public java.util.concurrent.ScheduledThreadPoolExecutor getScheduledThreadPoolExecutor()
public void setBrokerService(BrokerService brokerService)
setBrokerService in interface BrokerServiceAwarepublic BrokerService getBrokerService()
Copyright © 2005-2014 Red Hat, Inc.. All Rights Reserved.