public class SharedFileLocker extends AbstractLocker
Modifier and Type | Field and Description |
---|---|
static File |
DEFAULT_DIRECTORY |
protected File |
directory |
DEFAULT_LOCK_ACQUIRE_SLEEP_INTERVAL, failIfLocked, lockable, lockAcquireSleepInterval, name
Constructor and Description |
---|
SharedFileLocker() |
Modifier and Type | Method and Description |
---|---|
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() |
boolean |
keepAlive()
Used by a timer to keep alive the lock.
|
void |
setDirectory(File directory) |
getLockAcquireSleepInterval, setFailIfLocked, setLockable, setLockAcquireSleepInterval, setName
addServiceListener, dispose, isStarted, isStopped, isStopping, postStop, preStart, removeServiceListener, start, stop
public static final File DEFAULT_DIRECTORY
public SharedFileLocker()
public void doStart() throws Exception
doStart
in class ServiceSupport
Exception
public boolean keepAlive()
Locker
keepAlive
in interface Locker
keepAlive
in class AbstractLocker
public void doStop(ServiceStopper stopper) throws Exception
doStop
in class ServiceSupport
Exception
public File getDirectory()
public void setDirectory(File directory)
public void configure(PersistenceAdapter persistenceAdapter) throws IOException
Locker
IOException
Copyright © 2005–2017. All rights reserved.