uPortal 2.4.1
API Documentation

org.jasig.portal.concurrency.locking
Class EntityLockImpl

java.lang.Object
  extended byorg.jasig.portal.concurrency.locking.EntityLockImpl
All Implemented Interfaces:
IEntityLock

public class EntityLockImpl
extends java.lang.Object
implements IEntityLock

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.

Version:
$Revision: 1.6 $
Author:
Dan Ellentuck
See Also:
IEntityLock

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)
           
 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.
 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.
 java.lang.String toString()
          Returns a String that represents the value of this object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

convert

public void convert(int newType)
             throws LockingException
Delegate to the service.

Specified by:
convert in interface IEntityLock
Parameters:
newType - int
Throws:
LockingException - - if the conversion fails.

convert

public void convert(int newType,
                    int duration)
             throws LockingException
Delegate to the service.

Specified by:
convert in interface IEntityLock
Parameters:
newType - int
duration - int
Throws:
LockingException - - if the conversion fails.

equals

public boolean equals(java.lang.Object obj)
Parameters:
obj - the Object to compare with
Returns:
true if these Objects are equal; false otherwise.
See Also:
Hashtable

getEntityKey

public java.lang.String getEntityKey()
Specified by:
getEntityKey in interface IEntityLock
Returns:
java.lang.String

getEntityType

public java.lang.Class getEntityType()
Specified by:
getEntityType in interface IEntityLock
Returns:
java.lang.Class
See Also:
for known types.

getExpirationTime

public java.util.Date getExpirationTime()
Specified by:
getExpirationTime in interface IEntityLock
Returns:
java.util.Date

getLockOwner

public java.lang.String getLockOwner()
Could be the portal user or the framework or ...?

Specified by:
getLockOwner in interface IEntityLock
Returns:
java.lang.String

getLockType

public int getLockType()
See IEntityLockingService for a description of lock types.

Specified by:
getLockType in interface IEntityLock
Returns:
int

hashCode

public int hashCode()
This method is supported primarily for hash tables, such as those provided in java.util.

Returns:
an integer hash code for the receiver
See Also:
Hashtable

isLocked

public boolean isLocked()
Answer if the lock is unexpired.

Returns:
boolean

isValid

public boolean isValid()
                throws LockingException
Delegate to the service.

Specified by:
isValid in interface IEntityLock
Returns:
boolean
Throws:
LockingException

release

public void release()
             throws LockingException
Delegate to the service.

Specified by:
release in interface IEntityLock
Throws:
LockingException

renew

public void renew()
           throws LockingException
Delegate to the service.

Specified by:
renew in interface IEntityLock
Throws:
LockingException

renew

public void renew(int duration)
           throws LockingException
Delegate to the service.

Specified by:
renew in interface IEntityLock
Throws:
LockingException

toString

public java.lang.String toString()
Returns a String that represents the value of this object.

Returns:
a string representation of the receiver

uPortal 2.4.1
API Documentation