org.objectweb.dsrg.sofa.repository.core
Class RepositoryLocker

java.lang.Object
  extended by org.objectweb.dsrg.sofa.repository.core.RepositoryLocker

public class RepositoryLocker
extends java.lang.Object

Interface for remote manipulations with lock on SOFA repository servlet. See SofaServlet.


Field Summary
static int DEFAULT_LOCK_TIMEOUT
          Default timeout for locking the repository in seconds.
static int DEFAULT_SPIN_TIME
          Default spin interval when acquiring a lock in milliseconds.
 
Constructor Summary
RepositoryLocker()
           
 
Method Summary
static boolean isLocked(RepositoryConfiguration rc)
          Returns the status of the lock on repository servlet.
static boolean lock(RepositoryConfiguration rc)
          Locks the lock on repository servlet.
static boolean unlock(RepositoryConfiguration rc)
          Unlocks the lock on repository servlet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LOCK_TIMEOUT

public static int DEFAULT_LOCK_TIMEOUT
Default timeout for locking the repository in seconds.


DEFAULT_SPIN_TIME

public static int DEFAULT_SPIN_TIME
Default spin interval when acquiring a lock in milliseconds.

Constructor Detail

RepositoryLocker

public RepositoryLocker()
Method Detail

isLocked

public static boolean isLocked(RepositoryConfiguration rc)
                        throws java.io.IOException
Returns the status of the lock on repository servlet.

Parameters:
rc - Configuration of the repository.
Returns:
True if locked.
Throws:
java.io.IOException
See Also:
SofaServlet, lock(org.objectweb.dsrg.sofa.repository.model.RepositoryConfiguration), unlock(org.objectweb.dsrg.sofa.repository.model.RepositoryConfiguration)

lock

public static boolean lock(RepositoryConfiguration rc)
                    throws java.io.IOException
Locks the lock on repository servlet.

Parameters:
rc - Configuration of the repository.
Returns:
True on success.
Throws:
java.io.IOException
See Also:
SofaServlet, isLocked(org.objectweb.dsrg.sofa.repository.model.RepositoryConfiguration), unlock(org.objectweb.dsrg.sofa.repository.model.RepositoryConfiguration)

unlock

public static boolean unlock(RepositoryConfiguration rc)
                      throws java.io.IOException
Unlocks the lock on repository servlet.

Parameters:
rc - Configuration of the repository.
Returns:
True on success.
Throws:
java.io.IOException
See Also:
SofaServlet, isLocked(org.objectweb.dsrg.sofa.repository.model.RepositoryConfiguration), lock(org.objectweb.dsrg.sofa.repository.model.RepositoryConfiguration)