com.arjuna.ats.arjuna.common
Class ObjectStoreEnvironmentBean

java.lang.Object
  extended by com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean
All Implemented Interfaces:
ObjectStoreEnvironmentBeanMBean

public class ObjectStoreEnvironmentBean
extends java.lang.Object
implements ObjectStoreEnvironmentBeanMBean

A JavaBean containing configuration properties for the objectstore and various implementations thereof.

Author:
Jonathan Halliday (jonathan.halliday@redhat.com)

Constructor Summary
ObjectStoreEnvironmentBean()
           
 
Method Summary
 int getCacheStoreHash()
          Returns the number of hash buckets used for the cache work queue.
 int getCacheStoreRemovedItems()
          Returns the maximum number of removed items that may be held in the cache before being purged.
 int getCacheStoreScanPeriod()
          Returns the interval on which the cache will wake and process outstanding work.
 int getCacheStoreSize()
          Returns the maximum allowed size, in bytes, of the cache store's in-memory cache.
 int getCacheStoreWorkItems()
          Returns the maximum number of outstanding writes that may be held in the cache.
 int getHashedDirectories()
          Returns the number of directories over which the ObjectStore contents will be distributed.
 int getHierarchyRetry()
          Returns the maximum number of attempts which may be made to create a file path in the store.
 int getHierarchyTimeout()
          Returns the time in milliseconds to wait between file creation retries.
 int getJdbcPoolSizeInitial()
          Returns the number of connections to initialize in the pool at startup.
 int getJdbcPoolSizeMaximum()
          Returns the maximum number of connections to hold in the pool.
 java.lang.String getJdbcTxDbAccess()
          Returns the classname of the JDBCAccess implementation used for the ActionStore.
 java.lang.String getJdbcUserDbAccess()
          Returns the classname of the JDBCAccess implementation used for the ObjectStore.
 java.lang.String getLocalOSRoot()
          Returns the local ObjectStore root directory name.
 java.lang.String getObjectStoreDir()
          Returns the ObjectStore directory path.
 java.lang.String getObjectStoreType()
          Returns the symbolic name for the ObjectStore implementation.
 long getPurgeTime()
          Returns the purge interval for the LogStore, in milliseconds.
 int getShare()
          Returns the share mode for the ObjectStore, i.e., is this being shared between VMs? Default: ObjectStore.OS_UNKNOWN Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.share
 long getTxLogSize()
          Returns the default size of the LogStore file, in bytes.
 boolean isCacheStoreSync()
          Returns true if writes to the objectstore should include a disk sync.
 boolean isJdbcPoolPutConnections()
          Deprecated. I'm unused and should be removed.
 boolean isJmxEnabled()
          Determines whether JMX instrumentation of the Object Store is enabled.
 boolean isObjectStoreSync()
          Returns true if ObjectStore operations should be synched to disk.
 boolean isSynchronousRemoval()
          Returns true if the LogStore should write removal records synchronously.
 boolean isTransactionSync()
          Returns true if transaction log operations should be synched to disk.
 void setCacheStoreHash(int cacheStoreHash)
          Sets the number of hash buskets used to store the cache work queue.
 void setCacheStoreRemovedItems(int cacheStoreRemovedItems)
          Sets the maximum number of removed items that may be held in the cache before being purged.
 void setCacheStoreScanPeriod(int cacheStoreScanPeriod)
          Sets the interval on which the cache will process outstanding work, in milliseconds.
 void setCacheStoreSize(int cacheStoreSize)
          Sets the maximum size, in bytes, of the in-memory object state cache.
 void setCacheStoreSync(boolean cacheStoreSync)
          Sets if writes to the store should be synched to disk or not.
 void setCacheStoreWorkItems(int cacheStoreWorkItems)
          Sets the maximum number of outstanding writes that may be held in the cache.
 void setHashedDirectories(int hashedDirectories)
          Sets the number of directories over which the ObjectStore will be split.
 void setHierarchyRetry(int hierarchyRetry)
          Sets the maximum number of attempts which may be made to create a direcory tree in the store.
 void setHierarchyTimeout(int hierarchyTimeout)
          Sets the time in milliseconds to wait between file creation retries.
 void setJdbcPoolPutConnections(boolean jdbcPoolPutConnections)
          Sets if connections should be returned to the pool after use.
 void setJdbcPoolSizeInitial(int jdbcPoolSizeInitial)
          Sets the number of the connection to initialize in the pool at startup.
 void setJdbcPoolSizeMaximum(int jdbcPoolSizeMaximum)
          Sets the maximum number of connections to hold in the pool.
 void setJdbcTxDbAccess(java.lang.String jdbcTxDbAccess)
          Sets the classname of the JDBCAccess implementation used for the ActionStore.
 void setJdbcUserDbAccess(java.lang.String jdbcUserDbAccess)
          Sets the classname of the JDBCAccess implementation used for the ObjectStore.
 void setJmxEnabled(boolean enable)
          Enable or disable JMX instrumentation of the Object Store.
 void setLocalOSRoot(java.lang.String localOSRoot)
          Sets the local ObjectStore root directory name.
 void setObjectStoreDir(java.lang.String objectStoreDir)
          Sets the ObjectStore directory path.
 void setObjectStoreSync(boolean objectStoreSync)
          Sets if ObjectStore operations should be synched to disk or not.
 void setObjectStoreType(java.lang.String objectStoreType)
          Sets the symbolic name of the ObjectStore implementation.
 void setPurgeTime(long purgeTime)
          Sets the purge interval for the LogStore, in milliseconds.
 void setShare(int share)
          Sets the share mode of the ObjectStore
 void setSynchronousRemoval(boolean synchronousRemoval)
          Sets if the LogStore should write removal records synchronously or not.
 void setTransactionSync(boolean transactionSync)
          Sets if transaction log operations should be synched to disk or not.
 void setTxLogSize(long txLogSize)
          Sets the default size of the LogStore, in bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectStoreEnvironmentBean

public ObjectStoreEnvironmentBean()
Method Detail

getCacheStoreSize

public int getCacheStoreSize()
Returns the maximum allowed size, in bytes, of the cache store's in-memory cache. Default: 10240 bytes Equivalent deprecated property: com.arjuna.ats.internal.arjuna.objectstore.cacheStore.size

Specified by:
getCacheStoreSize in interface ObjectStoreEnvironmentBeanMBean
Returns:
the memory cache size in bytes.

setCacheStoreSize

public void setCacheStoreSize(int cacheStoreSize)
Sets the maximum size, in bytes, of the in-memory object state cache.

Specified by:
setCacheStoreSize in interface ObjectStoreEnvironmentBeanMBean
Parameters:
cacheStoreSize - the maximum cache size in bytes.

isCacheStoreSync

public boolean isCacheStoreSync()
Returns true if writes to the objectstore should include a disk sync. Unlikely to be worthwile since the store caches state in memory anyhow. Default: false Equivalent deprecated property: com.arjuna.ats.internal.arjuna.objectstore.cacheStore.sync

Specified by:
isCacheStoreSync in interface ObjectStoreEnvironmentBeanMBean
Returns:
true if writes should be synched to disk, false otherwise.

setCacheStoreSync

public void setCacheStoreSync(boolean cacheStoreSync)
Sets if writes to the store should be synched to disk or not.

Specified by:
setCacheStoreSync in interface ObjectStoreEnvironmentBeanMBean
Parameters:
cacheStoreSync - true to enable syncing, false to disable.

getCacheStoreRemovedItems

public int getCacheStoreRemovedItems()
Returns the maximum number of removed items that may be held in the cache before being purged. Default: 256 Equivalent deprecated property: com.arjuna.ats.internal.arjuna.objectstore.cacheStore.removedItems

Specified by:
getCacheStoreRemovedItems in interface ObjectStoreEnvironmentBeanMBean
Returns:
the maximum number of removed items in the cache.

setCacheStoreRemovedItems

public void setCacheStoreRemovedItems(int cacheStoreRemovedItems)
Sets the maximum number of removed items that may be held in the cache before being purged.

Specified by:
setCacheStoreRemovedItems in interface ObjectStoreEnvironmentBeanMBean
Parameters:
cacheStoreRemovedItems - teh maximun number of items.

getCacheStoreScanPeriod

public int getCacheStoreScanPeriod()
Returns the interval on which the cache will wake and process outstanding work. Default: 120000 milliseconds Equivalent deprecated property: com.arjuna.ats.internal.arjuna.objectstore.cacheStore.scanPeriod

Specified by:
getCacheStoreScanPeriod in interface ObjectStoreEnvironmentBeanMBean
Returns:
the work interval of the cache, in milliseconds.

setCacheStoreScanPeriod

public void setCacheStoreScanPeriod(int cacheStoreScanPeriod)
Sets the interval on which the cache will process outstanding work, in milliseconds.

Specified by:
setCacheStoreScanPeriod in interface ObjectStoreEnvironmentBeanMBean
Parameters:
cacheStoreScanPeriod - the sleep duration, in milliseconds.

getCacheStoreWorkItems

public int getCacheStoreWorkItems()
Returns the maximum number of outstanding writes that may be held in the cache. Default: 100 Equivalent deprecated property: com.arjuna.ats.internal.arjuna.objectstore.cacheStore.workItems

Specified by:
getCacheStoreWorkItems in interface ObjectStoreEnvironmentBeanMBean
Returns:
the maximum number of outstanding writes in the cache.

setCacheStoreWorkItems

public void setCacheStoreWorkItems(int cacheStoreWorkItems)
Sets the maximum number of outstanding writes that may be held in the cache.

Specified by:
setCacheStoreWorkItems in interface ObjectStoreEnvironmentBeanMBean
Parameters:
cacheStoreWorkItems - the maximum number of outstnading writes.

getCacheStoreHash

public int getCacheStoreHash()
Returns the number of hash buckets used for the cache work queue. Default: 128 Equivalent deprecated property: com.arjuna.ats.internal.arjuna.objectstore.cacheStore.hash

Specified by:
getCacheStoreHash in interface ObjectStoreEnvironmentBeanMBean
Returns:
the number of hash buckets used to store the cache state.

setCacheStoreHash

public void setCacheStoreHash(int cacheStoreHash)
Sets the number of hash buskets used to store the cache work queue.

Specified by:
setCacheStoreHash in interface ObjectStoreEnvironmentBeanMBean
Parameters:
cacheStoreHash - the number of hash buckets.

getLocalOSRoot

public java.lang.String getLocalOSRoot()
Returns the local ObjectStore root directory name. This should be a path element, not a complete path. Default: "defaultStore" Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.localOSRoot

Specified by:
getLocalOSRoot in interface ObjectStoreEnvironmentBeanMBean
Returns:
the local ObjectStore root directory name.

setLocalOSRoot

public void setLocalOSRoot(java.lang.String localOSRoot)
Sets the local ObjectStore root directory name. This shold be a path element, not a complete path.

Specified by:
setLocalOSRoot in interface ObjectStoreEnvironmentBeanMBean
Parameters:
localOSRoot - the directory name.

getObjectStoreDir

public java.lang.String getObjectStoreDir()
Returns the ObjectStore directory path. Default: {user.dir}/ObjectStore Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.objectStoreDir

Specified by:
getObjectStoreDir in interface ObjectStoreEnvironmentBeanMBean
Returns:
the ObjectStore directory path.

setObjectStoreDir

public void setObjectStoreDir(java.lang.String objectStoreDir)
Sets the ObjectStore directory path.

Specified by:
setObjectStoreDir in interface ObjectStoreEnvironmentBeanMBean
Parameters:
objectStoreDir - the directory path.

isObjectStoreSync

public boolean isObjectStoreSync()
Returns true if ObjectStore operations should be synched to disk. Note that this value may be overridden by store implementation specific configuration. See also: isTransactionSync Default: true Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.objectStoreSync

Specified by:
isObjectStoreSync in interface ObjectStoreEnvironmentBeanMBean
Returns:
true for synched operations, false otherwise.

setObjectStoreSync

public void setObjectStoreSync(boolean objectStoreSync)
Sets if ObjectStore operations should be synched to disk or not. Caution: Disabling this may be lead to non-ACID transaction behaviour.

Specified by:
setObjectStoreSync in interface ObjectStoreEnvironmentBeanMBean
Parameters:
objectStoreSync - true to sunc to disk, false to skip synching.

getObjectStoreType

public java.lang.String getObjectStoreType()
Returns the symbolic name for the ObjectStore implementation. Default: "ShadowNoFileLockStore" TODO test Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.objectStoreType

Specified by:
getObjectStoreType in interface ObjectStoreEnvironmentBeanMBean
Returns:
the symbolic name of the ObjectStore implementation.

setObjectStoreType

public void setObjectStoreType(java.lang.String objectStoreType)
Sets the symbolic name of the ObjectStore implementation.

Specified by:
setObjectStoreType in interface ObjectStoreEnvironmentBeanMBean
Parameters:
objectStoreType - the symbolic name of the implementation.

getHashedDirectories

public int getHashedDirectories()
Returns the number of directories over which the ObjectStore contents will be distributed. Splitting the contents is important for performance on some file systems, as it reduces chain length (number of items in a directory) and directory lock contention. Default: 255 Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.hashedDirectories

Specified by:
getHashedDirectories in interface ObjectStoreEnvironmentBeanMBean
Returns:
the number of directories over which to distribute the store.

setHashedDirectories

public void setHashedDirectories(int hashedDirectories)
Sets the number of directories over which the ObjectStore will be split.

Specified by:
setHashedDirectories in interface ObjectStoreEnvironmentBeanMBean
Parameters:
hashedDirectories - the number of directories.

isTransactionSync

public boolean isTransactionSync()
Returns true if transaction log operations should be synched to disk. Default: true Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.transactionSync

Specified by:
isTransactionSync in interface ObjectStoreEnvironmentBeanMBean
Returns:
true if operations should be forcedto disk, false otherwise.

setTransactionSync

public void setTransactionSync(boolean transactionSync)
Sets if transaction log operations should be synched to disk or not. Caution: Disabling this may be lead to non-ACID transaction behaviour.

Specified by:
setTransactionSync in interface ObjectStoreEnvironmentBeanMBean
Parameters:
transactionSync - true to enable synching, false to disable.

getJdbcUserDbAccess

public java.lang.String getJdbcUserDbAccess()
Returns the classname of the JDBCAccess implementation used for the ObjectStore. Default: null Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.jdbcUserDbAccess

Specified by:
getJdbcUserDbAccess in interface ObjectStoreEnvironmentBeanMBean
Returns:
the name of a class implementing JDBCAccess.

setJdbcUserDbAccess

public void setJdbcUserDbAccess(java.lang.String jdbcUserDbAccess)
Sets the classname of the JDBCAccess implementation used for the ObjectStore.

Specified by:
setJdbcUserDbAccess in interface ObjectStoreEnvironmentBeanMBean
Parameters:
jdbcUserDbAccess - the name of the class implementing JDBCAccess.

getJdbcTxDbAccess

public java.lang.String getJdbcTxDbAccess()
Returns the classname of the JDBCAccess implementation used for the ActionStore. Default: null Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.jdbcTxDbAccess

Specified by:
getJdbcTxDbAccess in interface ObjectStoreEnvironmentBeanMBean
Returns:
the name of a class implementing JDBCAccess.

setJdbcTxDbAccess

public void setJdbcTxDbAccess(java.lang.String jdbcTxDbAccess)
Sets the classname of the JDBCAccess implementation used for the ActionStore.

Specified by:
setJdbcTxDbAccess in interface ObjectStoreEnvironmentBeanMBean
Parameters:
jdbcTxDbAccess - the name of the class implementing JDBCAccess.

getJdbcPoolSizeInitial

public int getJdbcPoolSizeInitial()
Returns the number of connections to initialize in the pool at startup. Default: 1 Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.jdbcPoolSizeInitial

Specified by:
getJdbcPoolSizeInitial in interface ObjectStoreEnvironmentBeanMBean
Returns:
the initial size of the connection pool.

setJdbcPoolSizeInitial

public void setJdbcPoolSizeInitial(int jdbcPoolSizeInitial)
Sets the number of the connection to initialize in the pool at startup.

Specified by:
setJdbcPoolSizeInitial in interface ObjectStoreEnvironmentBeanMBean
Parameters:
jdbcPoolSizeInitial - the initial size of the connection pool.

getJdbcPoolSizeMaximum

public int getJdbcPoolSizeMaximum()
Returns the maximum number of connections to hold in the pool. Default: 1 Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.jdbcPoolSizeMaximum"

Specified by:
getJdbcPoolSizeMaximum in interface ObjectStoreEnvironmentBeanMBean
Returns:
the maximum size of the connection pool.

setJdbcPoolSizeMaximum

public void setJdbcPoolSizeMaximum(int jdbcPoolSizeMaximum)
Sets the maximum number of connections to hold in the pool.

Specified by:
setJdbcPoolSizeMaximum in interface ObjectStoreEnvironmentBeanMBean
Parameters:
jdbcPoolSizeMaximum - the maximum size of the connection pool.

isJdbcPoolPutConnections

public boolean isJdbcPoolPutConnections()
Deprecated. I'm unused and should be removed.

Returns if connections should be returned to the pool after use. Default: false Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.jdbcPoolPutConnections

Specified by:
isJdbcPoolPutConnections in interface ObjectStoreEnvironmentBeanMBean
Returns:
true if connections should be reused, false otherwise.

setJdbcPoolPutConnections

public void setJdbcPoolPutConnections(boolean jdbcPoolPutConnections)
Sets if connections should be returned to the pool after use.

Specified by:
setJdbcPoolPutConnections in interface ObjectStoreEnvironmentBeanMBean
Parameters:
jdbcPoolPutConnections - true to enable connection reuse, false to disable.

getShare

public int getShare()
Returns the share mode for the ObjectStore, i.e., is this being shared between VMs? Default: ObjectStore.OS_UNKNOWN Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.share

Specified by:
getShare in interface ObjectStoreEnvironmentBeanMBean
Returns:
the default share mode.

setShare

public void setShare(int share)
Sets the share mode of the ObjectStore

Specified by:
setShare in interface ObjectStoreEnvironmentBeanMBean
Parameters:
share - a valid share mode.

getHierarchyRetry

public int getHierarchyRetry()
Returns the maximum number of attempts which may be made to create a file path in the store. Default: 100 Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.hierarchyRetry

Specified by:
getHierarchyRetry in interface ObjectStoreEnvironmentBeanMBean
Returns:
the maximum number of attempts to create a nested directory tree.

setHierarchyRetry

public void setHierarchyRetry(int hierarchyRetry)
Sets the maximum number of attempts which may be made to create a direcory tree in the store.

Specified by:
setHierarchyRetry in interface ObjectStoreEnvironmentBeanMBean
Parameters:
hierarchyRetry - the maximum number of file creation attempts.

getHierarchyTimeout

public int getHierarchyTimeout()
Returns the time in milliseconds to wait between file creation retries. Default: 100 milliseconds. Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.hierarchyTimeout

Specified by:
getHierarchyTimeout in interface ObjectStoreEnvironmentBeanMBean
Returns:
the time to wait before retrying a failed file creation, in milliseconds.

setHierarchyTimeout

public void setHierarchyTimeout(int hierarchyTimeout)
Sets the time in milliseconds to wait between file creation retries.

Specified by:
setHierarchyTimeout in interface ObjectStoreEnvironmentBeanMBean
Parameters:
hierarchyTimeout - the wait time in milliseconds.

isSynchronousRemoval

public boolean isSynchronousRemoval()
Returns true if the LogStore should write removal records synchronously. Disabling this may increase performance at the cost of recovery complexity. Default: true Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.transactionLog.synchronousRemoval

Specified by:
isSynchronousRemoval in interface ObjectStoreEnvironmentBeanMBean
Returns:
true for synchronous removals, false for buffered (asynchronous) operation.

setSynchronousRemoval

public void setSynchronousRemoval(boolean synchronousRemoval)
Sets if the LogStore should write removal records synchronously or not.

Specified by:
setSynchronousRemoval in interface ObjectStoreEnvironmentBeanMBean
Parameters:
synchronousRemoval - true for synchronous operation, false for asynchronous.

getTxLogSize

public long getTxLogSize()
Returns the default size of the LogStore file, in bytes. Default: 10MB Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.transactionLog.txLogSize

Specified by:
getTxLogSize in interface ObjectStoreEnvironmentBeanMBean
Returns:
the default file size for the LogStore, in bytes.

setTxLogSize

public void setTxLogSize(long txLogSize)
Sets the default size of the LogStore, in bytes.

Specified by:
setTxLogSize in interface ObjectStoreEnvironmentBeanMBean
Parameters:
txLogSize - the default file size, in bytes.

getPurgeTime

public long getPurgeTime()
Returns the purge interval for the LogStore, in milliseconds. Default: 100000 milliseconds Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.transactionLog.purgeTime

Specified by:
getPurgeTime in interface ObjectStoreEnvironmentBeanMBean
Returns:
the purge interval in milliseconds.

setPurgeTime

public void setPurgeTime(long purgeTime)
Sets the purge interval for the LogStore, in milliseconds.

Specified by:
setPurgeTime in interface ObjectStoreEnvironmentBeanMBean
Parameters:
purgeTime - the purge interval in milliseconds.

isJmxEnabled

public boolean isJmxEnabled()
Determines whether JMX instrumentation of the Object Store is enabled.

Specified by:
isJmxEnabled in interface ObjectStoreEnvironmentBeanMBean
Returns:
true if JMX instrumentation is enabled

setJmxEnabled

public void setJmxEnabled(boolean enable)
Enable or disable JMX instrumentation of the Object Store.

Specified by:
setJmxEnabled in interface ObjectStoreEnvironmentBeanMBean
Parameters:
enable - set to true to enable.