lumis.portal.lock
Class LockManager

Package class diagram package LockManager
java.lang.Object
  extended by lumis.portal.lock.LockManager
All Implemented Interfaces:
ILockManager

public class LockManager
extends Object
implements ILockManager

Manager implementation for lock-related operations

Since:
4.2.0

Constructor Summary
LockManager()
           
 
Method Summary
 Lock getLock(String resourceId)
          Returns a cluster-wide lock object for the specified resource.
 void unlockExpiredLocks()
          Deletes all the locks that have expired.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LockManager

public LockManager()
Method Detail

getLock

public Lock getLock(String resourceId)
Description copied from interface: ILockManager
Returns a cluster-wide lock object for the specified resource.

See lumis.portal.lock for details about the consequences of the lock scope being cluster-wide.

The lock implementation returned does not support conditions. The Lock.newCondition() method throws UnsupportedOperationException.

If this method is called multiple times with the same resourceId value, the lock objects returned use a common synchronizing resource. This way, calling Lock.lock() on any of these lock objects will generate a lock in the same resource (and these locks will block each other). But a Lock.unlock() must still be executed in the same Lock instance on which the lock was acquired, since it is considered the owner of that lock.

Specified by:
getLock in interface ILockManager
Parameters:
resourceId - the identifier of the resource the lock refers to. It is recommended to name the identifier using Java class name style (e.g. com.company.module.etc.MyResource) to prevent naming conflicts on different implementations.
Returns:
the lock object.
See Also:
lumis.portal.lock

unlockExpiredLocks

public void unlockExpiredLocks()
                        throws PortalException
Description copied from interface: ILockManager
Deletes all the locks that have expired.

Specified by:
unlockExpiredLocks in interface ILockManager
Throws:
PortalException


Lumisportal  5.5.0.091130 - Copyright © 2001-2007, Lumis. All Rights Reserved.