public abstract class SailBase extends Object implements Sail
Modifier and Type | Field and Description |
---|---|
protected long |
connectionTimeOut
Connection timeout on shutdown (in ms).
|
protected static long |
DEFAULT_CONNECTION_TIMEOUT
Default connection timeout on shutdown: 20,000 milliseconds.
|
protected ReentrantReadWriteLock |
initializationLock
Lock used to synchronize the initialization state of a sail.
|
protected Logger |
logger |
Constructor and Description |
---|
SailBase() |
Modifier and Type | Method and Description |
---|---|
protected void |
connectionClosed(SailConnection connection)
Signals to the store that the supplied connection has been closed; called
by
SailConnectionBase.close() . |
protected static boolean |
debugEnabled() |
SailConnection |
getConnection()
Opens a connection on the Sail which can be used to query and update data.
|
protected abstract SailConnection |
getConnectionInternal()
Returns a store-specific SailConnection object.
|
File |
getDataDir()
Gets the Sail's data directory.
|
void |
initialize()
Initializes the Sail.
|
protected void |
initializeInternal()
Do store-specific operations to initialize the store.
|
protected boolean |
isInitialized()
Checks whether the Sail has been initialized.
|
void |
setDataDir(File dataDir)
Sets the data directory for the Sail.
|
void |
shutDown()
Shuts down the Sail, giving it the opportunity to synchronize any stale
data.
|
protected abstract void |
shutDownInternal()
Do store-specific operations to ensure proper shutdown of the store.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getValueFactory, isWritable
protected static final long DEFAULT_CONNECTION_TIMEOUT
protected final Logger logger
protected final ReentrantReadWriteLock initializationLock
protected volatile long connectionTimeOut
DEFAULT_CONNECTION_TIMEOUT
.protected static boolean debugEnabled()
public void setDataDir(File dataDir)
Sail
initialized
.setDataDir
in interface Sail
public File getDataDir()
Sail
getDataDir
in interface Sail
Sail.setDataDir(File)
protected boolean isInitialized()
initialization
until shutdown
.public void initialize() throws SailException
Sail
initialize
in interface Sail
SailException
- If the Sail could not be initialized.protected void initializeInternal() throws SailException
SailException
public void shutDown() throws SailException
Sail
shutDown
in interface Sail
SailException
- If the Sail object encountered an error or unexpected situation
internally.protected abstract void shutDownInternal() throws SailException
SailException
public SailConnection getConnection() throws SailException
Sail
getConnection
in interface Sail
SailException
- If no transaction could be started, for example because the Sail
is not writable.protected abstract SailConnection getConnectionInternal() throws SailException
SailException
protected void connectionClosed(SailConnection connection)
SailConnectionBase.close()
.connection
- The connection that has been closed.Copyright © 2001-2013 Aduna. All Rights Reserved.