org.lexevs.registry
Class WriteLockManager

java.lang.Object
  extended by org.lexevs.registry.WriteLockManager

public class WriteLockManager
extends java.lang.Object

This class is used for managing write locks between multiple JVMs running in the same enviroment.

Version:
subversion $Revision: $ checked in on $Date: $
Author:
Dan Armbrust, Jesse Erdmann

Method Summary
 void acquireLock(java.lang.String urn, java.lang.String version)
          Lock an individual terminology for loading, indexing, etc.
 void checkForRegistryUpdates()
          See if another vm or thread has written a newer version of the registry file.
 int getLockCount()
          Gets the lock count.
protected static LgLoggerIF getLogger()
          Gets the logger.
static WriteLockManager instance()
          Instance.
static WriteLockManager instance(java.io.File registryFile)
          Instance.
 void lockLockFile()
          Lock lock file.
 void registryWasRevised()
          Registry was revised.
 void releaseLock(java.lang.String urn, java.lang.String version)
          Unlock a particular coding scheme (finished loading, indexing, etc).
 void releaseLockFile()
          Release lock file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLogger

protected static LgLoggerIF getLogger()
Gets the logger.

Returns:
the logger

instance

public static WriteLockManager instance()
                                 throws LBInvocationException
Instance.

Returns:
the write lock manager
Throws:
LBInvocationException - the LB invocation exception

instance

public static WriteLockManager instance(java.io.File registryFile)
                                 throws LBInvocationException
Instance.

Parameters:
registryFile - the registry file
Returns:
the write lock manager
Throws:
LBInvocationException - the LB invocation exception

acquireLock

public void acquireLock(java.lang.String urn,
                        java.lang.String version)
                 throws LBInvocationException,
                        LBParameterException
Lock an individual terminology for loading, indexing, etc.

Parameters:
urn - the urn
version - the version
Throws:
LBInvocationException - the LB invocation exception
LBParameterException - the LB parameter exception

releaseLock

public void releaseLock(java.lang.String urn,
                        java.lang.String version)
                 throws LBInvocationException,
                        LBParameterException
Unlock a particular coding scheme (finished loading, indexing, etc).

Parameters:
urn - the urn
version - the version
Throws:
LBInvocationException - the LB invocation exception
LBParameterException - the LB parameter exception

registryWasRevised

public void registryWasRevised()
                        throws LBInvocationException
Registry was revised.

Throws:
LBInvocationException - the LB invocation exception

checkForRegistryUpdates

public void checkForRegistryUpdates()
                             throws LBInvocationException
See if another vm or thread has written a newer version of the registry file. If yes, reload the resource manager.

Throws:
UnexpectedInternalError - * @throws LBInvocationException the LB invocation exception
LBInvocationException

lockLockFile

public void lockLockFile()
                  throws LBInvocationException
Lock lock file.

Throws:
LBInvocationException - the LB invocation exception

releaseLockFile

public void releaseLockFile()
Release lock file.


getLockCount

public int getLockCount()
Gets the lock count.

Returns:
the lock count

Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER.