Package org.apache.activemq.store
Class SharedFileLocker
java.lang.Object
org.apache.activemq.util.ServiceSupport
org.apache.activemq.broker.AbstractLocker
org.apache.activemq.store.SharedFileLocker
- All Implemented Interfaces:
Locker,org.apache.activemq.Service
Represents an exclusive lock on a database to avoid multiple brokers running
against the same logical database.
-
Field Summary
FieldsFields inherited from class org.apache.activemq.broker.AbstractLocker
DEFAULT_LOCK_ACQUIRE_SLEEP_INTERVAL, failIfLocked, lockable, lockAcquireSleepInterval, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(PersistenceAdapter persistenceAdapter) Optionally configure the locker with the persistence adapter currently used You can use persistence adapter configuration details like, data directory datasource, etc. to be used by the lockervoiddoStart()voiddoStop(org.apache.activemq.util.ServiceStopper stopper) booleanUsed by a timer to keep alive the lock.voidsetDirectory(File directory) Methods inherited from class org.apache.activemq.broker.AbstractLocker
getLockAcquireSleepInterval, setFailIfLocked, setLockable, setLockAcquireSleepInterval, setNameMethods inherited from class org.apache.activemq.util.ServiceSupport
addServiceListener, dispose, isStarted, isStopped, isStopping, postStop, preStart, removeServiceListener, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.activemq.Service
start, stop
-
Field Details
-
DEFAULT_DIRECTORY
-
directory
-
-
Constructor Details
-
SharedFileLocker
public SharedFileLocker()
-
-
Method Details
-
doStart
- Specified by:
doStartin classorg.apache.activemq.util.ServiceSupport- Throws:
Exception
-
keepAlive
public boolean keepAlive()Description copied from interface:LockerUsed by a timer to keep alive the lock. If the method returns false the broker should be terminated if an exception is thrown, the lock state cannot be determined- Specified by:
keepAlivein interfaceLocker- Overrides:
keepAlivein classAbstractLocker
-
doStop
- Specified by:
doStopin classorg.apache.activemq.util.ServiceSupport- Throws:
Exception
-
getDirectory
-
setDirectory
-
configure
Description copied from interface:LockerOptionally configure the locker with the persistence adapter currently used You can use persistence adapter configuration details like, data directory datasource, etc. to be used by the locker- Throws:
IOException
-