|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.portal.concurrency.locking.ReferenceEntityLockService
public class ReferenceEntityLockService
| Field Summary |
|---|
| Fields inherited from interface org.jasig.portal.concurrency.IEntityLockService |
|---|
READ_LOCK, WRITE_LOCK |
| Constructor Summary | |
|---|---|
ReferenceEntityLockService()
ReferenceEntityLockingService constructor comment. |
|
| Method Summary | |
|---|---|
void |
convert(IEntityLock lock,
int newType)
Attempts to change the lock's lockType to newType. |
void |
convert(IEntityLock lock,
int newType,
int newDuration)
Attempts to change the lock's lockType to newType. |
boolean |
existsInStore(IEntityLock lock)
Answer if this IEntityLock exists in the store. |
boolean |
isValid(IEntityLock lock)
Answers if this IEntityLock represents a lock that is still
good. |
IEntityLock |
newLock(Class entityType,
String entityKey,
int lockType,
String owner)
Returns a lock for the entity, lock type and owner if no conflicting locks exist. |
IEntityLock |
newLock(Class entityType,
String entityKey,
int lockType,
String owner,
int durationSecs)
Returns a lock for the entity, lock type and owner if no conflicting locks exist. |
IEntityLock |
newLock(EntityIdentifier entityID,
int lockType,
String owner)
Returns a lock for the entity, lock type and owner if no conflicting locks exist. |
IEntityLock |
newLock(EntityIdentifier entityID,
int lockType,
String owner,
int durationSecs)
Returns a lock for the entity, lock type and owner if no conflicting locks exist. |
void |
release(IEntityLock lock)
Releases the IEntityLock. |
void |
renew(IEntityLock lock)
Extends the expiration time of the lock by some service-defined increment. |
void |
renew(IEntityLock lock,
int duration)
Extends the expiration time of the lock by some service-defined increment. |
static IEntityLockService |
singleton()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReferenceEntityLockService()
throws LockingException
LockingException| Method Detail |
|---|
public void convert(IEntityLock lock,
int newType)
throws LockingException
lockType to newType.
convert in interface IEntityLockServicelock - IEntityLocknewType - int
LockingException
public void convert(IEntityLock lock,
int newType,
int newDuration)
throws LockingException
lockType to newType.
convert in interface IEntityLockServicelock - IEntityLocknewType - intnewDuration - int
LockingException
public boolean existsInStore(IEntityLock lock)
throws LockingException
IEntityLock exists in the store.
existsInStore in interface IEntityLockServicelock -
LockingException
public boolean isValid(IEntityLock lock)
throws LockingException
IEntityLock represents a lock that is still
good. To be valid, a lock must exist in the underlying store and be
unexpired.
isValid in interface IEntityLockServicelock - IEntityLock
LockingException
public IEntityLock newLock(Class entityType,
String entityKey,
int lockType,
String owner)
throws LockingException
newLock in interface IEntityLockServiceentityType - entityKey - lockType - owner -
LockingException
public IEntityLock newLock(Class entityType,
String entityKey,
int lockType,
String owner,
int durationSecs)
throws LockingException
newLock in interface IEntityLockServiceentityType - entityKey - lockType - owner - durationSecs -
LockingException - Retrieves potentially conflicting locks and checks them before adding
the new lock to the store. The add of a write lock will fail if any
other lock exists for the entity. The add of a read lock will fail if
a write lock exists for the entity. After we add a write lock we
check the store a second time and roll back if any other lock has snuck
in. I think this is slightly safer than depending on the db isolation
level for transactional integrity.
public IEntityLock newLock(EntityIdentifier entityID,
int lockType,
String owner)
throws LockingException
newLock in interface IEntityLockServiceentityID - org.jasig.portal.EntityIdentifierlockType - intowner - String
LockingException
public IEntityLock newLock(EntityIdentifier entityID,
int lockType,
String owner,
int durationSecs)
throws LockingException
newLock in interface IEntityLockServiceentityID - org.jasig.portal.EntityIdentifierlockType - intowner - StringdurationSecs - int
LockingException
public void release(IEntityLock lock)
throws LockingException
IEntityLock.
release in interface IEntityLockServicelock - IEntityLock
LockingException
public void renew(IEntityLock lock)
throws LockingException
renew in interface IEntityLockServicelock - IEntityLock
LockingException
public void renew(IEntityLock lock,
int duration)
throws LockingException
renew in interface IEntityLockServicelock - IEntityLock
LockingException
public static IEntityLockService singleton()
throws LockingException
LockingException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||