org.apache.activemq.store
Class SharedFileLocker

java.lang.Object
  extended by org.apache.activemq.util.ServiceSupport
      extended by org.apache.activemq.broker.AbstractLocker
          extended by org.apache.activemq.store.SharedFileLocker
All Implemented Interfaces:
Locker, Service

public class SharedFileLocker
extends AbstractLocker

Represents an exclusive lock on a database to avoid multiple brokers running against the same logical database.


Field Summary
protected  File directory
           
 
Fields inherited from class org.apache.activemq.broker.AbstractLocker
DEFAULT_LOCK_ACQUIRE_SLEEP_INTERVAL, failIfLocked, lockAcquireSleepInterval, name
 
Constructor Summary
SharedFileLocker()
           
 
Method Summary
 void configure(PersistenceAdapter persistenceAdapter)
          Optionally configure the locker with the persistence adapter currently used You can use persistence adapter configuration details like, data directory datasource, etc.
 void doStart()
           
 void doStop(ServiceStopper stopper)
           
 File getDirectory()
           
 void setDirectory(File directory)
           
 
Methods inherited from class org.apache.activemq.broker.AbstractLocker
keepAlive, setFailIfLocked, setLockAcquireSleepInterval, setName
 
Methods inherited from class org.apache.activemq.util.ServiceSupport
addServiceListener, dispose, isStarted, isStopped, isStopping, postStop, preStart, removeServiceListener, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.activemq.Service
start, stop
 

Field Detail

directory

protected File directory
Constructor Detail

SharedFileLocker

public SharedFileLocker()
Method Detail

doStart

public void doStart()
             throws Exception
Specified by:
doStart in class ServiceSupport
Throws:
Exception

doStop

public void doStop(ServiceStopper stopper)
            throws Exception
Specified by:
doStop in class ServiceSupport
Throws:
Exception

getDirectory

public File getDirectory()

setDirectory

public void setDirectory(File directory)

configure

public void configure(PersistenceAdapter persistenceAdapter)
               throws IOException
Description copied from interface: Locker
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 locker

Throws:
IOException


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.