|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.portal.concurrency.locking.MemoryEntityLockStore
public class MemoryEntityLockStore
In-memory store for IEntityLocks.
| Field Summary | |
|---|---|
private java.util.Map |
lockCache
|
private static IEntityLockStore |
singleton
|
| Constructor Summary | |
|---|---|
MemoryEntityLockStore()
MemoryEntityLockStore constructor comment. |
|
| Method Summary | |
|---|---|
void |
add(IEntityLock lock)
Adds this IEntityLock to the store. |
void |
delete(IEntityLock lock)
Deletes this IEntityLock from the store. |
void |
deleteAll()
Delete all IEntityLocks from the store. |
void |
deleteExpired(java.util.Date expiration)
Deletes the expired IEntityLocks from the underlying store. |
IEntityLock[] |
find(java.lang.Class entityType,
java.lang.String entityKey,
java.lang.Integer lockType,
java.util.Date expiration,
java.lang.String lockOwner)
Returns an IEntityLock[] based on the params, any or all of which may be null. |
IEntityLock |
find(IEntityLock lock)
Returns this lock if it exists in the store. |
IEntityLock[] |
findUnexpired(java.util.Date expiration,
java.lang.Class entityType,
java.lang.String entityKey,
java.lang.Integer lockType,
java.lang.String lockOwner)
Returns an IEntityLock[] containing unexpired locks, based on the params, any or all of which may be null EXCEPT FOR expiration. |
private java.lang.String |
getCacheKey(IEntityLock lock)
|
private java.util.Map |
getLockCache()
|
private java.util.Map |
getLockCache(java.lang.Class type)
|
private IEntityLock |
getLockFromCache(java.lang.Object cacheKey,
java.util.Map cache)
|
private void |
initializeCache()
|
private void |
primAdd(IEntityLock lock,
java.util.Date expiration)
Adds this IEntityLock to the store. |
private void |
setLockCache(java.util.Map newLockCache)
|
static IEntityLockStore |
singleton()
|
void |
update(IEntityLock lock,
java.util.Date newExpiration)
Updates the lock's expiration in the underlying store. |
void |
update(IEntityLock lock,
java.util.Date newExpiration,
java.lang.Integer newLockType)
Make sure the store has a reference to the lock, and then add the lock to refresh the SmartCache wrapper. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static IEntityLockStore singleton
private java.util.Map lockCache
| Constructor Detail |
|---|
public MemoryEntityLockStore()
| Method Detail |
|---|
public void add(IEntityLock lock)
throws LockingException
add in interface IEntityLockStorelock -
LockingException
public void delete(IEntityLock lock)
throws LockingException
delete in interface IEntityLockStorelock -
LockingExceptionpublic void deleteAll()
IEntityLockStore
deleteAll in interface IEntityLockStore
public void deleteExpired(java.util.Date expiration)
throws LockingException
deleteExpired in interface IEntityLockStoreexpiration - java.util.Date
LockingException
public IEntityLock[] find(java.lang.Class entityType,
java.lang.String entityKey,
java.lang.Integer lockType,
java.util.Date expiration,
java.lang.String lockOwner)
throws LockingException
find(myType,myKey,null,null,null) will
return all IEntityLocks for myType and myKey.
find in interface IEntityLockStoreentityType - ClassentityKey - StringlockType - Integer - so we can accept a null value.expiration - DatelockOwner - String
LockingException - - wraps an Exception specific to the store.
public IEntityLock find(IEntityLock lock)
throws LockingException
lock -
LockingException
public IEntityLock[] findUnexpired(java.util.Date expiration,
java.lang.Class entityType,
java.lang.String entityKey,
java.lang.Integer lockType,
java.lang.String lockOwner)
throws LockingException
expiration. A null
param means any value, so find(expir,myType,myKey,null,null)
will return all IEntityLocks for myType and myKey unexpired
as of expir.
findUnexpired in interface IEntityLockStoreexpiration - DateentityType - ClassentityKey - StringlockType - Integer - so we can accept a null value.lockOwner - String
LockingException - - wraps an Exception specific to the store.private java.lang.String getCacheKey(IEntityLock lock)
lock - org.jasig.portal.concurrency.locking.IEntityLockprivate java.util.Map getLockCache()
private java.util.Map getLockCache(java.lang.Class type)
private IEntityLock getLockFromCache(java.lang.Object cacheKey,
java.util.Map cache)
private void initializeCache()
private void setLockCache(java.util.Map newLockCache)
newLockCache - java.util.Mappublic static IEntityLockStore singleton()
public void update(IEntityLock lock,
java.util.Date newExpiration)
throws LockingException
IEntityLockStoreexpiration in the underlying store.
update in interface IEntityLockStorelock - newExpiration -
LockingException
public void update(IEntityLock lock,
java.util.Date newExpiration,
java.lang.Integer newLockType)
throws LockingException
update in interface IEntityLockStorelock - org.jasig.portal.concurrency.locking.IEntityLocknewExpiration - java.util.DatenewLockType - Integer
LockingException
private void primAdd(IEntityLock lock,
java.util.Date expiration)
throws LockingException
lock - expiration -
LockingException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||