uPortal 2.4.1
API Documentation

org.jasig.portal.concurrency.locking
Class ReferenceEntityLockService

java.lang.Object
  extended byorg.jasig.portal.concurrency.locking.ReferenceEntityLockService
All Implemented Interfaces:
IEntityLockService

public class ReferenceEntityLockService
extends java.lang.Object
implements IEntityLockService

Version:
$Revision: 1.10 $
Author:
Dan Ellentuck

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(java.lang.Class entityType, java.lang.String entityKey, int lockType, java.lang.String owner)
          Returns a lock for the entity, lock type and owner if no conflicting locks exist.
 IEntityLock newLock(java.lang.Class entityType, java.lang.String entityKey, int lockType, java.lang.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, java.lang.String owner)
          Returns a lock for the entity, lock type and owner if no conflicting locks exist.
 IEntityLock newLock(EntityIdentifier entityID, int lockType, java.lang.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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReferenceEntityLockService

public ReferenceEntityLockService()
                           throws LockingException
ReferenceEntityLockingService constructor comment.

Method Detail

convert

public void convert(IEntityLock lock,
                    int newType)
             throws LockingException
Attempts to change the lock's lockType to newType.

Specified by:
convert in interface IEntityLockService
Parameters:
lock - IEntityLock
newType - int
Throws:
LockingException

convert

public void convert(IEntityLock lock,
                    int newType,
                    int newDuration)
             throws LockingException
Attempts to change the lock's lockType to newType.

Specified by:
convert in interface IEntityLockService
Parameters:
lock - IEntityLock
newType - int
newDuration - int
Throws:
LockingException

existsInStore

public boolean existsInStore(IEntityLock lock)
                      throws LockingException
Answer if this IEntityLock exists in the store.

Specified by:
existsInStore in interface IEntityLockService
Parameters:
lock -
Returns:
boolean
Throws:
LockingException

isValid

public boolean isValid(IEntityLock lock)
                throws LockingException
Answers if this IEntityLock represents a lock that is still good. To be valid, a lock must exist in the underlying store and be unexpired.

Specified by:
isValid in interface IEntityLockService
Parameters:
lock - IEntityLock
Throws:
LockingException

newLock

public IEntityLock newLock(java.lang.Class entityType,
                           java.lang.String entityKey,
                           int lockType,
                           java.lang.String owner)
                    throws LockingException
Returns a lock for the entity, lock type and owner if no conflicting locks exist.

Specified by:
newLock in interface IEntityLockService
Parameters:
entityType -
entityKey -
lockType -
owner -
Returns:
org.jasig.portal.groups.IEntityLock
Throws:
LockingException

newLock

public IEntityLock newLock(java.lang.Class entityType,
                           java.lang.String entityKey,
                           int lockType,
                           java.lang.String owner,
                           int durationSecs)
                    throws LockingException
Returns a lock for the entity, lock type and owner if no conflicting locks exist.

Specified by:
newLock in interface IEntityLockService
Parameters:
entityType -
entityKey -
lockType -
owner -
durationSecs -
Returns:
org.jasig.portal.groups.IEntityLock
Throws:
LockingException

newLock

public IEntityLock newLock(EntityIdentifier entityID,
                           int lockType,
                           java.lang.String owner)
                    throws LockingException
Returns a lock for the entity, lock type and owner if no conflicting locks exist.

Specified by:
newLock in interface IEntityLockService
Parameters:
entityID - org.jasig.portal.EntityIdentifier
lockType - int
owner - String
Returns:
org.jasig.portal.groups.IEntityLock
Throws:
LockingException

newLock

public IEntityLock newLock(EntityIdentifier entityID,
                           int lockType,
                           java.lang.String owner,
                           int durationSecs)
                    throws LockingException
Returns a lock for the entity, lock type and owner if no conflicting locks exist.

Specified by:
newLock in interface IEntityLockService
Parameters:
entityID - org.jasig.portal.EntityIdentifier
lockType - int
owner - String
durationSecs - int
Returns:
org.jasig.portal.groups.IEntityLock
Throws:
LockingException

release

public void release(IEntityLock lock)
             throws LockingException
Releases the IEntityLock.

Specified by:
release in interface IEntityLockService
Parameters:
lock - IEntityLock
Throws:
LockingException

renew

public void renew(IEntityLock lock)
           throws LockingException
Extends the expiration time of the lock by some service-defined increment.

Specified by:
renew in interface IEntityLockService
Parameters:
lock - IEntityLock
Throws:
LockingException

renew

public void renew(IEntityLock lock,
                  int duration)
           throws LockingException
Extends the expiration time of the lock by some service-defined increment.

Specified by:
renew in interface IEntityLockService
Parameters:
lock - IEntityLock
duration -
Throws:
LockingException

singleton

public static IEntityLockService singleton()
                                    throws LockingException
Returns:
org.jasig.portal.concurrency.locking.ReferenceEntityLockService
Throws:
LockingException

uPortal 2.4.1
API Documentation