rrdService.service
Class LockTable

java.lang.Object
  |
  +--java.util.Dictionary
        |
        +--java.util.Hashtable
              |
              +--rrdService.service.LockTable
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class LockTable
extends java.util.Hashtable

The class LockTable allows to keep lock of RoundRobin

Version:
1.0 date : 15/07/2001
key-word
shared variable
Author:
Damien Pellier
See Also:
LockTable, LockRoundRobinDataBase LockRoundRobinLibrary Mutex, Serialized Form

Inner classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
private  java.io.File mountLibrary
          mountlibrary the mount library
private static Mutex mutex
          allows the synchonization of the acces to the lockTable
 
Fields inherited from class java.util.Hashtable
count, emptyEnumerator, emptyIterator, ENTRIES, entrySet, KEYS, keySet, loadFactor, modCount, serialVersionUID, table, threshold, values, VALUES
 
Constructor Summary
LockTable(java.io.File mountLibrary)
          Constructor of class LockTable
 
Method Summary
 Lock getLock(java.lang.String key)
          getLock return the Lock withe the scpecific key
private  void initLockTable(java.io.File directory)
          initLockTable scan the mount library and initialiize the lockTable
 Lock putLock(java.lang.String key, Lock lock)
          putLock Maps the specified key to the specified value in this hashtable.
 void rehashLockTable()
          rehashLockTable Increases the capacity of and internally reorganizes this hashtable, in order to accommodate and access its entries more efficiently.
 Lock removeLock(java.lang.String key)
          removeLock Removes the key (and its corresponding value) from this LockTable
 java.lang.String toString()
          toString return a string representation of a Lock Table
 
Methods inherited from class java.util.Hashtable
, clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, getEnumeration, getIterator, hashCode, isEmpty, keys, keySet, put, putAll, readObject, rehash, remove, size, values, writeObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

mountLibrary

private java.io.File mountLibrary
mountlibrary the mount library

mutex

private static Mutex mutex
allows the synchonization of the acces to the lockTable
Constructor Detail

LockTable

public LockTable(java.io.File mountLibrary)
          throws java.lang.Exception
Constructor of class LockTable
Parameters:
mountLibrary - the mount library
Method Detail

getLock

public Lock getLock(java.lang.String key)
             throws java.lang.Exception
getLock return the Lock withe the scpecific key
Parameters:
key - a string representing the file mount of RoundRobin to return
Returns:
Lock the lock associate with the key

initLockTable

private void initLockTable(java.io.File directory)
                    throws java.lang.Exception
initLockTable scan the mount library and initialiize the lockTable
Parameters:
directory - the mount directory of the mount library

putLock

public Lock putLock(java.lang.String key,
                    Lock lock)
putLock Maps the specified key to the specified value in this hashtable. Neither the key nor the value can be null.
Parameters:
key - a string representing the file mount of RoundRobin to put
lock - the lock of RoundRobin
Returns:
Lock the lock add

rehashLockTable

public void rehashLockTable()
                     throws java.lang.Exception
rehashLockTable Increases the capacity of and internally reorganizes this hashtable, in order to accommodate and access its entries more efficiently. This method is called automatically when the number of keys in the hashtable exceeds this hashtable's capacity and load factor. More over re-init the LockTable

removeLock

public Lock removeLock(java.lang.String key)
                throws java.lang.Exception
removeLock Removes the key (and its corresponding value) from this LockTable
Parameters:
key - a string representing the file mount of RoundRobin to remove
Returns:
Lock the lock associate with the key removed

toString

public java.lang.String toString()
toString return a string representation of a Lock Table
Overrides:
toString in class java.util.Hashtable
Returns:
a string representation of a Lock Table

Copyright 1885-2001 FIRMENICH SA, Geneva

Submit a bug or feature
Copyright 1885-2001 FIRMENICH SA, Geneva,
All Rights Reserved.