visidia.simulation.evtack
Class Locker

java.lang.Object
  extended by visidia.simulation.evtack.Locker

public class Locker
extends java.lang.Object

The Locker class manages locks, and stores them in a hash table. A lock is an object associated to a unique id.


Method Summary
 java.lang.Long createLock()
          Creates a lock, and puts it it the hash table.
static Locker getInstance()
          Gets the single instance of Locker.
 java.lang.Object getLock(java.lang.Long lockId)
          Gets the lock.
 java.lang.Object removeLock(java.lang.Long lockId)
          Removes the lock from the hash table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Locker getInstance()
Gets the single instance of Locker.

Returns:
single instance of Locker

createLock

public java.lang.Long createLock()
Creates a lock, and puts it it the hash table.

Returns:
the lock id

removeLock

public java.lang.Object removeLock(java.lang.Long lockId)
Removes the lock from the hash table.

Parameters:
lockId - the lock id
Returns:
the lock object

getLock

public java.lang.Object getLock(java.lang.Long lockId)
Gets the lock.

Parameters:
lockId - the lock id
Returns:
the lock