net.ontopia.topicmaps.webed.impl.utils
Class NamedLockManager

java.lang.Object
  extended by net.ontopia.topicmaps.webed.impl.utils.NamedLockManager

public class NamedLockManager
extends java.lang.Object

INTERNAL: Class to handle basic lock controlling for objects in the web editor framework.


Constructor Summary
NamedLockManager()
           
 
Method Summary
 LockResult attemptToLock(UserIF user, java.util.Collection objects, java.lang.String nameBase, javax.servlet.http.HttpSession session, java.util.ResourceBundle resBundle)
          INTERNAL: Attempts to lock all the objects in the input collection and assigns name to the collection for later retrieval.
 void clear()
          INTERNAL: For testing purposes only.
 int lockCountFor(java.lang.Object user)
          INTERNAL: Returns the number of locks held by the user.
 boolean ownsLock(UserIF user, java.lang.String name)
          INTERNAL: Returns true if the user owns the given lock.
 void releaseLocksFor(UserIF user)
          INTERNAL: Releases all the locks that the user owns.
 void unlock(UserIF user, java.lang.String name, boolean forced)
          INTERNAL: If forced is false, unlocks the lock with the given 'name' for the given user.
static boolean usesTimedLockExpiry(javax.servlet.http.HttpSession session)
          INTERNAL: Returns true if the session has support for time-based lock expiry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamedLockManager

public NamedLockManager()
Method Detail

attemptToLock

public LockResult attemptToLock(UserIF user,
                                java.util.Collection objects,
                                java.lang.String nameBase,
                                javax.servlet.http.HttpSession session,
                                java.util.ResourceBundle resBundle)
INTERNAL: Attempts to lock all the objects in the input collection and assigns name to the collection for later retrieval.


unlock

public void unlock(UserIF user,
                   java.lang.String name,
                   boolean forced)
INTERNAL: If forced is false, unlocks the lock with the given 'name' for the given user. If forced is true, unlocks all locks starting with the stem of 'name', the stem being defined as everything before and including the last '$' character. These locks are unlocked independent on which user locked them.


ownsLock

public boolean ownsLock(UserIF user,
                        java.lang.String name)
INTERNAL: Returns true if the user owns the given lock.


releaseLocksFor

public void releaseLocksFor(UserIF user)
INTERNAL: Releases all the locks that the user owns.


usesTimedLockExpiry

public static boolean usesTimedLockExpiry(javax.servlet.http.HttpSession session)
INTERNAL: Returns true if the session has support for time-based lock expiry. For internal and testing purposes only.


lockCountFor

public int lockCountFor(java.lang.Object user)
INTERNAL: Returns the number of locks held by the user. For testing purposes only.


clear

public void clear()
INTERNAL: For testing purposes only.



Copyright © 2000-2012 Ontopia.