|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.portal.concurrency.locking.EntityLockImpl
public class EntityLockImpl
An implementation of IEntityLock. A lock is granted to a
lockOwner for an entityType and
entityKey. It guarantees some degree of exclusive
access to the entity, depending on lockType and
expirationTime.
IEntityLock| Field Summary | |
|---|---|
private java.lang.String |
entityKey
|
private java.lang.Class |
entityType
|
private java.util.Date |
expirationTime
|
private java.lang.String |
lockOwner
|
private int |
lockType
|
private IEntityLockService |
service
|
| Constructor Summary | |
|---|---|
protected |
EntityLockImpl(java.lang.Class newEntityType,
java.lang.String newEntityKey,
int newLockType,
java.util.Date newExpirationTime,
java.lang.String newLockOwner)
|
protected |
EntityLockImpl(java.lang.Class newEntityType,
java.lang.String newEntityKey,
int newLockType,
java.util.Date newExpirationTime,
java.lang.String newLockOwner,
IEntityLockService newService)
|
| Method Summary | |
|---|---|
void |
convert(int newType)
Delegate to the service. |
void |
convert(int newType,
int duration)
Delegate to the service. |
boolean |
equals(java.lang.Object obj)
|
protected void |
expire()
|
protected void |
finalize()
|
java.lang.String |
getEntityKey()
|
java.lang.Class |
getEntityType()
|
java.util.Date |
getExpirationTime()
|
java.lang.String |
getLockOwner()
Could be the portal user or the framework or ...? |
int |
getLockType()
See IEntityLockingService for a description of lock types. |
protected IEntityLockService |
getService()
|
int |
hashCode()
This method is supported primarily for hash tables, such as those provided in java.util. |
boolean |
isLocked()
Answer if the lock is unexpired. |
boolean |
isValid()
Delegate to the service. |
void |
release()
Delegate to the service. |
void |
renew()
Delegate to the service. |
void |
renew(int duration)
Delegate to the service. |
private void |
setEntityKey(java.lang.String newEntityKey)
|
private void |
setEntityType(java.lang.Class newEntityType)
|
(package private) void |
setExpirationTime(java.util.Date newExpirationTime)
|
private void |
setLockOwner(java.lang.String newLockOwner)
|
(package private) void |
setLockType(int newLockType)
|
private void |
setService(IEntityLockService newService)
|
java.lang.String |
toString()
Returns a String that represents the value of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private java.lang.Class entityType
private java.lang.String entityKey
private java.lang.String lockOwner
private java.util.Date expirationTime
private int lockType
private IEntityLockService service
| Constructor Detail |
|---|
protected EntityLockImpl(java.lang.Class newEntityType,
java.lang.String newEntityKey,
int newLockType,
java.util.Date newExpirationTime,
java.lang.String newLockOwner)
protected EntityLockImpl(java.lang.Class newEntityType,
java.lang.String newEntityKey,
int newLockType,
java.util.Date newExpirationTime,
java.lang.String newLockOwner,
IEntityLockService newService)
| Method Detail |
|---|
public void convert(int newType)
throws LockingException
convert in interface IEntityLocknewType - int
LockingException - - if the conversion fails.
public void convert(int newType,
int duration)
throws LockingException
convert in interface IEntityLocknewType - intduration - int
LockingException - - if the conversion fails.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the Object to compare with
Hashtableprotected void expire()
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic java.lang.String getEntityKey()
getEntityKey in interface IEntityLockpublic java.lang.Class getEntityType()
getEntityType in interface IEntityLockfor known types.public java.util.Date getExpirationTime()
getExpirationTime in interface IEntityLockpublic java.lang.String getLockOwner()
getLockOwner in interface IEntityLockpublic int getLockType()
getLockType in interface IEntityLockprotected IEntityLockService getService()
public int hashCode()
hashCode in class java.lang.ObjectHashtablepublic boolean isLocked()
public boolean isValid()
throws LockingException
isValid in interface IEntityLockLockingException
public void release()
throws LockingException
release in interface IEntityLockLockingException
public void renew()
throws LockingException
renew in interface IEntityLockLockingException
public void renew(int duration)
throws LockingException
renew in interface IEntityLockLockingExceptionprivate void setEntityKey(java.lang.String newEntityKey)
newEntityKey - private void setEntityType(java.lang.Class newEntityType)
newEntityType - void setExpirationTime(java.util.Date newExpirationTime)
newExpirationTime - private void setLockOwner(java.lang.String newLockOwner)
newLockOwner - void setLockType(int newLockType)
newLockType - private void setService(IEntityLockService newService)
newService - org.jasig.portal.concurrency.locking.IEntityLockServicepublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||