|
Oracle® Coherence Java API Reference v3.5 E14977-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.io.bdb.DatabaseFactory.EnvironmentHolder.DirectoryLock
protected static class DatabaseFactory.EnvironmentHolder.DirectoryLock
Directory based lock. <p/> A single instance of the DirectoryLock is not intended for inter thread locking. Multiple instance refering to the same File should be used instead.
Field Summary | |
---|---|
static java.lang.String |
LOCK_FILE_NAME Name of warning file. |
protected java.io.File |
m_dir Directory to lock. |
protected java.io.FileOutputStream |
m_fstreamLocked The FileStream which the actuall lock is held on. |
protected java.nio.channels.FileLock |
m_lockDir The actual FileLock. |
protected java.lang.String |
m_sLockText Text to include in the lock file. |
Constructor Summary | |
---|---|
DatabaseFactory.EnvironmentHolder.DirectoryLock(java.io.File dir, java.lang.String sLockText) Create a DirectoryLock which can be used to try to lock a directory. |
Method Summary | |
---|---|
protected void |
finalize() Automatically release the lock on finalization. |
boolean |
tryLock() Try to lock the directory. |
boolean |
tryUnlock() Try to unlock the directory. |
Field Detail |
---|
public static final java.lang.String LOCK_FILE_NAME
protected java.io.File m_dir
protected java.io.FileOutputStream m_fstreamLocked
protected java.nio.channels.FileLock m_lockDir
protected java.lang.String m_sLockText
Constructor Detail |
---|
public DatabaseFactory.EnvironmentHolder.DirectoryLock(java.io.File dir, java.lang.String sLockText)
dir
- the directory to locksLockText
- the text to include in the lock fileMethod Detail |
---|
public boolean tryLock() throws java.io.IOException
java.io.IOException
- if an IO error occurs while creating the lock filepublic boolean tryUnlock() throws java.io.IOException
java.io.IOException
- if an IO error occurs while deleting the lock file, the lock may be left in an unlocked stateprotected void finalize() throws java.lang.Throwable
java.lang.Throwable
|
Oracle® Coherence Java API Reference v3.5 E14977-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |