uPortal 2.4.1
API Documentation

org.jasig.portal.concurrency
Interface IEntityLock

All Known Implementing Classes:
EntityLockImpl

public interface IEntityLock

Defines a lock associated with an owner and a portal entity that guarantees some degree of exclusive access to the entity, depending on lockType and expirationTime. See IEntityLockService for the rules governing lock assignment and a code example.

Version:
$Revision: 1.3 $
Author:
Dan Ellentuck
See Also:
IEntityLockService

Method Summary
 void convert(int newType)
          Attempts to change the lockType of this lock to newType.
 void convert(int newType, int newDuration)
          Attempts to change the lockType of this lock to newType.
 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.
 boolean isValid()
          Answers if this lock is still good.
 void release()
          Invalidate the lock.
 void renew()
          Extends the expiration time of this lock for a service-defined period.
 void renew(int duration)
          Extends the expiration time of this lock for duration seconds.
 

Method Detail

convert

public void convert(int newType)
             throws LockingException
Attempts to change the lockType of this lock to newType. The expirationTime is renewed.

Parameters:
newType - int
Throws:
LockingException - - if the conversion fails.

convert

public void convert(int newType,
                    int newDuration)
             throws LockingException
Attempts to change the lockType of this lock to newType. The expirationTime is extended newDuration seconds.

Parameters:
newType - int
newDuration - int
Throws:
LockingException - - if the conversion fails.

getEntityKey

public java.lang.String getEntityKey()
Returns:
java.lang.String

getEntityType

public java.lang.Class getEntityType()
Returns:
java.lang.Class
See Also:
for known types.

getExpirationTime

public java.util.Date getExpirationTime()
Returns:
java.util.Date

getLockOwner

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

Returns:
java.lang.String

getLockType

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

Returns:
int

isValid

public boolean isValid()
                throws LockingException
Answers if this lock is still good.

Throws:
LockingException

release

public void release()
             throws LockingException
Invalidate the lock.

Throws:
LockingException

renew

public void renew()
           throws LockingException
Extends the expiration time of this lock for a service-defined period.

Throws:
LockingException

renew

public void renew(int duration)
           throws LockingException
Extends the expiration time of this lock for duration seconds.

Throws:
LockingException

uPortal 2.4.1
API Documentation