|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.slide.common.AbstractServiceBase
org.apache.slide.common.AbstractSimpleService
org.apache.slide.store.AbstractStore
org.apache.slide.store.ExtendedStore
Store that allows for transactional caching of data. Takes over much modified code from StandardStore. That's why Remy is listed as author as well.
Nested Class Summary | |
protected class |
ExtendedStore.TxCacheWrapper
|
protected class |
ExtendedStore.TxContentCacheWrapper
|
Fields inherited from class org.apache.slide.store.AbstractStore |
contentIndexer, contentStore, lockStore, nodeStore, parameters, propertiesIndexer, resourceManagers, revisionDescriptorsStore, revisionDescriptorStore, securityStore, sequenceStore |
Fields inherited from class org.apache.slide.common.AbstractSimpleService |
currentContext, rollbackOnly, status, transactionTimeout, TX_IDLE, TX_PREPARED, TX_SUSPENDED |
Fields inherited from class org.apache.slide.common.AbstractServiceBase |
namespace, scope |
Fields inherited from interface javax.transaction.xa.XAResource |
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY |
Constructor Summary | |
ExtendedStore()
|
Method Summary | |
void |
commit(javax.transaction.xa.Xid xid,
boolean onePhase)
Commit the global transaction specified by xid. |
void |
createObject(Uri uri,
ObjectNode object)
Create a new object in the Descriptors Store. |
void |
createRevisionContent(Uri uri,
NodeRevisionDescriptor revisionDescriptor,
NodeRevisionContent revisionContent)
Create a new revision |
void |
createRevisionDescriptor(Uri uri,
NodeRevisionDescriptor revisionDescriptor)
Create new revision descriptor. |
void |
createRevisionDescriptors(Uri uri,
NodeRevisionDescriptors revisionDescriptors)
Create new revision descriptors. |
void |
end(javax.transaction.xa.Xid xid,
int flags)
Ends the work performed on behalf of a transaction branch. |
java.util.Enumeration |
enumerateLocks(Uri uri)
Enumerate locks on an object. |
java.util.Enumeration |
enumeratePermissions(Uri uri)
Enumerate locks on an object. |
void |
exclusiveTransientLock(java.lang.String uri)
Acquires an exclusive access lock to a resource. |
protected void |
fatalError(java.lang.Error e)
|
protected void |
fatalError(java.lang.RuntimeException re)
|
protected java.util.Vector |
fillLocksCache(Uri uri)
|
protected java.util.Vector |
fillPermissionsCache(Uri uri)
|
void |
forget(javax.transaction.xa.Xid xid)
Tell the resource manager to forget about a heuristically completed transaction branch. |
void |
grantPermission(Uri uri,
NodePermission permission)
Store an object permissions in the Descriptors Store. |
protected void |
init(int globalObjectCacheSize,
int globalPermissionCacheSize,
int globalLockCacheSize,
int globalDescrtiptorsCacheSize,
int globalDescrtiptorCacheSize,
boolean contentCachingEnabled,
int globalContentCacheSize,
long contentCacheBytes,
int txContentCacheSize,
long txContentCacheBytes,
long maxByteSizePerEntry,
boolean noGlobalCacheInTx)
|
void |
killLock(Uri uri,
NodeLock lock)
Kills a lock. |
int |
prepare(javax.transaction.xa.Xid xid)
Ask the resource manager to prepare for a transaction commit of the transaction specified in xid. |
void |
putLock(Uri uri,
NodeLock lock)
Puts a lock on a subject. |
protected void |
releaseTransientLocks()
|
void |
removeLock(Uri uri,
NodeLock lock)
Removes (cancels) a lock. |
void |
removeObject(Uri uri,
ObjectNode object)
Remove an object from the Descriptors Store. |
void |
removeObjectFromCache(java.lang.Object key)
Removes an object from all internal caches. |
void |
removeRevisionContent(Uri uri,
NodeRevisionDescriptor revisionDescriptor)
Remove revision. |
void |
removeRevisionDescriptor(Uri uri,
NodeRevisionNumber number)
Remove revision descriptor. |
void |
removeRevisionDescriptors(Uri uri)
Remove revision descriptors. |
void |
renewLock(Uri uri,
NodeLock lock)
Renews a lock. |
void |
resetCache()
|
ObjectNode |
retrieveObject(Uri uri)
Retrive an object from the Descriptors Store. |
NodeRevisionContent |
retrieveRevisionContent(Uri uri,
NodeRevisionDescriptor revisionDescriptor)
Retrive revision content. |
NodeRevisionDescriptor |
retrieveRevisionDescriptor(Uri uri,
NodeRevisionNumber revisionNumber)
Retrieve revision descriptor. |
NodeRevisionDescriptors |
retrieveRevisionDescriptors(Uri uri)
Retrieve a revision descriptors. |
void |
revokePermission(Uri uri,
NodePermission permission)
Store an object permissions in the Descriptors Store. |
void |
revokePermissions(Uri uri)
Revoke all the permissions on the object. |
void |
rollback(javax.transaction.xa.Xid xid)
Inform the resource manager to roll back work done on behalf of a transaction branch. |
void |
setParameters(java.util.Hashtable parameters)
Remeber the store parameters to initialise the default child stores on request |
void |
start(javax.transaction.xa.Xid xid,
int flags)
Start work on behalf of a transaction branch specified in xid. |
void |
storeObject(Uri uri,
ObjectNode object)
Store an object in the Descriptors Store. |
void |
storeRevisionContent(Uri uri,
NodeRevisionDescriptor revisionDescriptor,
NodeRevisionContent revisionContent)
Modify the latest revision of an object. |
void |
storeRevisionDescriptor(Uri uri,
NodeRevisionDescriptor revisionDescriptor)
Update revision descriptor. |
void |
storeRevisionDescriptors(Uri uri,
NodeRevisionDescriptors revisionDescriptors)
Update revision descriptors. |
java.lang.String |
toString()
|
Methods inherited from class org.apache.slide.store.AbstractStore |
addResourceManager, connect, connect, createSequence, delist, delist, delist, disconnect, enlist, enlist, getContentIndexer, getName, getParameter, getPropertiesIndexer, initialize, isConnected, isForceStoreEnlistment, isSequenceSupported, nextSequenceValue, reset, sequenceExists, setContentIndexer, setContentStore, setLockStore, setName, setNamespace, setNodeStore, setPropertiesIndexer, setRevisionDescriptorsStore, setRevisionDescriptorStore, setRollbackOnly, setScope, setSecurityStore, setSequenceStore, useBinding |
Methods inherited from class org.apache.slide.common.AbstractSimpleService |
getTransactionTimeout, isSameRM, recover, setTransactionTimeout |
Methods inherited from class org.apache.slide.common.AbstractServiceBase |
cacheResults, connectIfNeeded, connectIfNeeded, getLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.slide.common.Service |
cacheResults, connectIfNeeded, connectIfNeeded, getLogger |
Methods inherited from interface javax.transaction.xa.XAResource |
getTransactionTimeout, isSameRM, recover, setTransactionTimeout |
Field Detail |
protected static final int DEFAULT_OBJECT_GLOBAL_CACHE_SIZE
protected static final java.lang.String GLOBAL_OBJECT_CACHE_SIZE_PARAMETER
protected static final int DEFAULT_GLOBAL_PERMISSION_CACHE_SIZE
protected static final java.lang.String GLOBAL_PERMISSION_CACHE_SIZE_PARAMETER
protected static final int DEFAULT_GLOBAL_LOCK_CACHE_SIZE
protected static final java.lang.String GLOBAL_LOCK_CACHE_SIZE_PARAMETER
protected static final int DEFAULT_GLOBAL_DESCRIPTORS_CACHE_SIZE
protected static final java.lang.String GLOBAL_DESCRIPTORS_CACHE_SIZE_PARAMETER
protected static final int DEFAULT_GLOBAL_DESCRIPTOR_CACHE_SIZE
protected static final java.lang.String GLOBAL_DESCRIPTOR_CACHE_SIZE_PARAMETER
protected static final int DEFAULT_GLOBAL_CONTENT_CACHE_SIZE
protected static final java.lang.String GLOBAL_CONTENT_CACHE_SIZE_PARAMETER
protected static final boolean DEFAULT_ENABLE_CONTENT_CACHING
protected static final java.lang.String ENABLE_CONTENT_CACHING_PARAMETER
protected static final int DEFAULT_TX_CONTENT_CACHE_SIZE
protected static final java.lang.String TX_CONTENT_CACHE_SIZE_PARAMETER
protected static final long DEFAULT_CONTENT_CACHE_BYTES
protected static final java.lang.String CONTENT_CACHE_BYTES_PARAMETER
protected static final long DEFAULT_TX_CONTENT_CACHE_BYTES
protected static final java.lang.String TX_CONTENT_CACHE_BYTES_PARAMETER
protected static final long DEFAULT_MAX_CONTENT_BYTES_PER_ENTRY
protected static final java.lang.String MAX_CONTENT_BYTES_PER_ENTRY_PARAMETER
protected static final java.lang.String CACHE_MODE_PARAMETER
protected static final java.lang.String CACHE_MODE_FULL
protected static final java.lang.String CACHE_MODE_LOCAL
protected static final java.lang.String CACHE_MODE_NO_GLOBAL_IN_TX
protected static final java.lang.String CACHE_MODE_OFF
protected static final java.lang.String DEFAULT_CACHE_MODE
protected static final int DEFAULT_TLOCK_TIMEOUT
protected static final java.lang.String TLOCK_TIMEOUT_PARAMETER
protected java.lang.ThreadLocal activeTransactionBranch
protected ExtendedStore.TxContentCacheWrapper contentCache
protected ExtendedStore.TxCacheWrapper objectsCache
protected ExtendedStore.TxCacheWrapper permissionsCache
protected ExtendedStore.TxCacheWrapper locksCache
protected ExtendedStore.TxCacheWrapper descriptorsCache
protected ExtendedStore.TxCacheWrapper descriptorCache
protected org.apache.commons.transaction.locking.GenericLockManager lockManager
protected java.lang.ThreadLocal locks
protected long timeout
protected boolean globalCacheOff
int globalObjectCacheSize
int globalPermissionCacheSize
int globalLockCacheSize
int globalDescrtiptorsCacheSize
int globalDescrtiptorCacheSize
boolean contentCachingEnabled
int globalContentCacheSize
long contentCacheBytes
int txContentCacheSize
long txContentCacheBytes
long maxByteSizePerEntry
boolean noGlobalCacheInTx
Constructor Detail |
public ExtendedStore()
Method Detail |
public void setParameters(java.util.Hashtable parameters) throws ServiceParameterErrorException, ServiceParameterMissingException
AbstractStore
setParameters
in interface Service
setParameters
in class AbstractStore
parameters
- Hashtable containing the parameters' name
and associated value
ServiceParameterMissingException
- Service parameter missing
ServiceParameterErrorException
- Incorrect service parameterpublic void resetCache()
public void removeObjectFromCache(java.lang.Object key)
key
- the key under which the object is stored in the caches.public void exclusiveTransientLock(java.lang.String uri) throws ServiceAccessException
Store
exclusiveTransientLock
in interface Store
exclusiveTransientLock
in class AbstractStore
ServiceAccessException
public NodeRevisionContent retrieveRevisionContent(Uri uri, NodeRevisionDescriptor revisionDescriptor) throws ServiceAccessException, RevisionNotFoundException
AbstractStore
retrieveRevisionContent
in interface ContentStore
retrieveRevisionContent
in class AbstractStore
uri
- UrirevisionDescriptor
- Node revision descriptor
ServiceAccessException
RevisionNotFoundException
public void createRevisionContent(Uri uri, NodeRevisionDescriptor revisionDescriptor, NodeRevisionContent revisionContent) throws ServiceAccessException, RevisionAlreadyExistException
AbstractStore
createRevisionContent
in interface ContentStore
createRevisionContent
in class AbstractStore
uri
- UrirevisionDescriptor
- Node revision descriptorrevisionContent
- Node revision content
ServiceAccessException
RevisionAlreadyExistException
public void storeRevisionContent(Uri uri, NodeRevisionDescriptor revisionDescriptor, NodeRevisionContent revisionContent) throws ServiceAccessException, RevisionNotFoundException
AbstractStore
storeRevisionContent
in interface ContentStore
storeRevisionContent
in class AbstractStore
uri
- UrirevisionDescriptor
- Node revision descriptorrevisionContent
- Node revision content
ServiceAccessException
RevisionNotFoundException
public void removeRevisionContent(Uri uri, NodeRevisionDescriptor revisionDescriptor) throws ServiceAccessException
AbstractStore
removeRevisionContent
in interface ContentStore
removeRevisionContent
in class AbstractStore
uri
- UrirevisionDescriptor
- Node revision descriptor
ServiceAccessException
public ObjectNode retrieveObject(Uri uri) throws ServiceAccessException, ObjectNotFoundException
AbstractStore
retrieveObject
in interface NodeStore
retrieveObject
in class AbstractStore
uri
- Uri of the object we want to retrieve
ObjectNotFoundException
- The object to retrieve was not found
ServiceAccessException
- Error accessing the Descriptors Storepublic void storeObject(Uri uri, ObjectNode object) throws ServiceAccessException, ObjectNotFoundException
AbstractStore
storeObject
in interface NodeStore
storeObject
in class AbstractStore
object
- Object to update
ObjectNotFoundException
- The object to update was not found
ServiceAccessException
- Error accessing the Descriptors Storepublic void createObject(Uri uri, ObjectNode object) throws ServiceAccessException, ObjectAlreadyExistsException
AbstractStore
createObject
in interface NodeStore
createObject
in class AbstractStore
object
- SlideObjecturi
- Uri of the object we want to create
ServiceAccessException
- Error accessing the Descriptors Store
ObjectAlreadyExistsException
- An object already exists
at this Uripublic void removeObject(Uri uri, ObjectNode object) throws ServiceAccessException, ObjectNotFoundException
AbstractStore
removeObject
in interface NodeStore
removeObject
in class AbstractStore
object
- Object to remove
ServiceAccessException
- Error accessing the Descriptors Store
ObjectNotFoundException
- The object to remove was not foundpublic void grantPermission(Uri uri, NodePermission permission) throws ServiceAccessException
AbstractStore
grantPermission
in interface SecurityStore
grantPermission
in class AbstractStore
permission
- Permission we want to create
ServiceAccessException
- Error accessing the Descriptors Storepublic void revokePermission(Uri uri, NodePermission permission) throws ServiceAccessException
AbstractStore
revokePermission
in interface SecurityStore
revokePermission
in class AbstractStore
permission
- Permission we want to create
ServiceAccessException
- Error accessing the Descriptors Storepublic void revokePermissions(Uri uri) throws ServiceAccessException
AbstractStore
revokePermissions
in interface SecurityStore
revokePermissions
in class AbstractStore
uri
- Uri of the object
ServiceAccessException
- Error accessing the Descriptors Storepublic java.util.Enumeration enumeratePermissions(Uri uri) throws ServiceAccessException
AbstractStore
enumeratePermissions
in interface SecurityStore
enumeratePermissions
in class AbstractStore
uri
- Uri of the subject
locks
which have been put on the subject
ServiceAccessException
- Service access errorpublic void putLock(Uri uri, NodeLock lock) throws ServiceAccessException
AbstractStore
putLock
in interface LockStore
putLock
in class AbstractStore
lock
- Lock token
ServiceAccessException
- Service access errorpublic void renewLock(Uri uri, NodeLock lock) throws ServiceAccessException, LockTokenNotFoundException
AbstractStore
renewLock
in interface LockStore
renewLock
in class AbstractStore
lock
- Token to renew
LockTokenNotFoundException
- Lock token was not found
ServiceAccessException
- Service access errorpublic void removeLock(Uri uri, NodeLock lock) throws ServiceAccessException, LockTokenNotFoundException
AbstractStore
removeLock
in interface LockStore
removeLock
in class AbstractStore
lock
- Token to remove
ServiceAccessException
- Service access error
LockTokenNotFoundException
- Lock token was not foundpublic void killLock(Uri uri, NodeLock lock) throws ServiceAccessException, LockTokenNotFoundException
AbstractStore
killLock
in interface LockStore
killLock
in class AbstractStore
lock
- Token to remove
ServiceAccessException
- Service access error
LockTokenNotFoundException
- Lock token was not foundpublic java.util.Enumeration enumerateLocks(Uri uri) throws ServiceAccessException
AbstractStore
enumerateLocks
in interface LockStore
enumerateLocks
in class AbstractStore
uri
- Uri of the subject
locks
which have been put on the subject
ServiceAccessException
- Service access errorpublic NodeRevisionDescriptors retrieveRevisionDescriptors(Uri uri) throws ServiceAccessException, RevisionDescriptorNotFoundException
AbstractStore
retrieveRevisionDescriptors
in interface RevisionDescriptorsStore
retrieveRevisionDescriptors
in class AbstractStore
uri
- Uri
RevisionDescriptorNotFoundException
- Revision descriptor
was not found
ServiceAccessException
- Service access errorpublic void createRevisionDescriptors(Uri uri, NodeRevisionDescriptors revisionDescriptors) throws ServiceAccessException
AbstractStore
createRevisionDescriptors
in interface RevisionDescriptorsStore
createRevisionDescriptors
in class AbstractStore
uri
- UrirevisionDescriptors
- Node revision descriptors
ServiceAccessException
- Service access errorpublic void storeRevisionDescriptors(Uri uri, NodeRevisionDescriptors revisionDescriptors) throws ServiceAccessException, RevisionDescriptorNotFoundException
AbstractStore
storeRevisionDescriptors
in interface RevisionDescriptorsStore
storeRevisionDescriptors
in class AbstractStore
uri
- UrirevisionDescriptors
- Node revision descriptors
RevisionDescriptorNotFoundException
- Revision descriptor
was not found
ServiceAccessException
- Service access errorpublic void removeRevisionDescriptors(Uri uri) throws ServiceAccessException
AbstractStore
removeRevisionDescriptors
in interface RevisionDescriptorsStore
removeRevisionDescriptors
in class AbstractStore
uri
- Uri
ServiceAccessException
- Service access errorpublic NodeRevisionDescriptor retrieveRevisionDescriptor(Uri uri, NodeRevisionNumber revisionNumber) throws ServiceAccessException, RevisionDescriptorNotFoundException
AbstractStore
retrieveRevisionDescriptor
in interface RevisionDescriptorStore
retrieveRevisionDescriptor
in class AbstractStore
uri
- urirevisionNumber
- Node revision number
ServiceAccessException
RevisionDescriptorNotFoundException
public void createRevisionDescriptor(Uri uri, NodeRevisionDescriptor revisionDescriptor) throws ServiceAccessException
AbstractStore
createRevisionDescriptor
in interface RevisionDescriptorStore
createRevisionDescriptor
in class AbstractStore
uri
- UrirevisionDescriptor
- Node revision descriptor
ServiceAccessException
- Service access errorpublic void storeRevisionDescriptor(Uri uri, NodeRevisionDescriptor revisionDescriptor) throws ServiceAccessException, RevisionDescriptorNotFoundException
AbstractStore
storeRevisionDescriptor
in interface RevisionDescriptorStore
storeRevisionDescriptor
in class AbstractStore
uri
- UrirevisionDescriptor
- Node revision descriptor
RevisionDescriptorNotFoundException
- Revision descriptor
was not found
ServiceAccessException
- Service access errorpublic void removeRevisionDescriptor(Uri uri, NodeRevisionNumber number) throws ServiceAccessException
AbstractStore
removeRevisionDescriptor
in interface RevisionDescriptorStore
removeRevisionDescriptor
in class AbstractStore
uri
- Uri
ServiceAccessException
- Service access errorpublic void forget(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
AbstractStore
forget
in interface javax.transaction.xa.XAResource
forget
in class AbstractStore
xid
- A global transaction identifier
javax.transaction.xa.XAException
- An error has occurred. Possible exception values
are XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO.public void rollback(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
AbstractStore
rollback
in interface javax.transaction.xa.XAResource
rollback
in class AbstractStore
xid
- A global transaction identifier
javax.transaction.xa.XAException
- An error has occurredpublic void commit(javax.transaction.xa.Xid xid, boolean onePhase) throws javax.transaction.xa.XAException
AbstractStore
commit
in interface javax.transaction.xa.XAResource
commit
in class AbstractStore
xid
- A global transaction identifieronePhase
- If true, the resource manager should use a one-phase
commit protocol to commit the work done on behalf of xid.
javax.transaction.xa.XAException
- An error has occurred. Possible XAExceptions
are XA_HEURHAZ, XA_HEURCOM, XA_HEURRB, XA_HEURMIX, XAER_RMERR,
XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO. If the resource
manager did not commit the transaction and the paramether onePhase is
set to true, the resource manager may throw one of the XA_RB*
exceptions. Upon return, the resource manager has rolled back the
branch's work and has released all held resources.public int prepare(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
AbstractStore
prepare
in interface javax.transaction.xa.XAResource
prepare
in class AbstractStore
xid
- A global transaction identifier
javax.transaction.xa.XAException
- An error has occurred. Possible exception
values are: XA_RB*, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL,
or XAER_PROTO.public void start(javax.transaction.xa.Xid xid, int flags) throws javax.transaction.xa.XAException
AbstractStore
start
in interface javax.transaction.xa.XAResource
start
in class AbstractStore
xid
- A global transaction identifier to be associated with the
resourceflags
- One of TMNOFLAGS, TMJOIN, or TMRESUME
javax.transaction.xa.XAException
- An error has occurred. Possible exceptions are
XA_RB*, XAER_RMERR, XAER_RMFAIL, XAER_DUPID, XAER_OUTSIDE, XAER_NOTA,
XAER_INVAL, or XAER_PROTO.public void end(javax.transaction.xa.Xid xid, int flags) throws javax.transaction.xa.XAException
AbstractStore
end
in interface javax.transaction.xa.XAResource
end
in class AbstractStore
xid
- A global transaction identifier that is the same as what
was used previously in the start method.flags
- One of TMSUCCESS, TMFAIL, or TMSUSPEND
javax.transaction.xa.XAException
- An error has occurred. Possible XAException
values are XAER_RMERR, XAER_RMFAILED, XAER_NOTA, XAER_INVAL,
XAER_PROTO, or XA_RB*.public java.lang.String toString()
protected void releaseTransientLocks()
protected java.util.Vector fillPermissionsCache(Uri uri) throws ServiceAccessException
ServiceAccessException
protected java.util.Vector fillLocksCache(Uri uri) throws ServiceAccessException
ServiceAccessException
protected void init(int globalObjectCacheSize, int globalPermissionCacheSize, int globalLockCacheSize, int globalDescrtiptorsCacheSize, int globalDescrtiptorCacheSize, boolean contentCachingEnabled, int globalContentCacheSize, long contentCacheBytes, int txContentCacheSize, long txContentCacheBytes, long maxByteSizePerEntry, boolean noGlobalCacheInTx)
protected void fatalError(java.lang.Error e)
protected void fatalError(java.lang.RuntimeException re)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |