kieker.webgui.service.impl.utility
Class LockManager

java.lang.Object
  extended by kieker.webgui.service.impl.utility.LockManager

public final class LockManager
extends Object

This manager is responsible for locking critical code using keys. Internally we use ReentrantLocks, but make sure that they are removed once they are no longer needed. The manager has been developed with a simple design. If necessary, the manager can be modified in order to provide a faster access to the locks.

Author:
Nils Christian Ehmke

Constructor Summary
LockManager()
          Creates a new instance of this class.
 
Method Summary
 void lock(String key)
          Locks the object for the given key.
 void lock(String[] keys)
          Locks the objects for the given keys in a definite order.
 void unlock(String key)
          Unlocks the object for the given key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LockManager

public LockManager()
Creates a new instance of this class.

Method Detail

lock

public void lock(String[] keys)
Locks the objects for the given keys in a definite order.

Parameters:
keys - The keys used for the locking.

lock

public void lock(String key)
Locks the object for the given key.

Parameters:
key - The key used for the locking.

unlock

public void unlock(String key)
Unlocks the object for the given key.

Parameters:
key - The key used for the unlocking.


Copyright © 2015. All rights reserved.