|
Openfire 3.4.1 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.util.lock.LockManager
public class LockManager
Manager of Locks
that could be valid when running within a cluster or when in local mode.
By default the LockManager will use a LocalLockFactory
but
you can set new factories by sending setLockFactory(LockFactory)
.
Constructor Summary | |
---|---|
LockManager()
|
Method Summary | |
---|---|
static Lock |
getLock(Object key)
Returns an existing Lock on the specified key or creates a new one if none was found. |
static LockFactory |
getLockFactory()
Returns the existing lock factory being used for creating new Locks. |
static void |
setLockFactory(LockFactory lockFactory)
Sets the lock factory to use for creating new Locks. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LockManager()
Method Detail |
---|
public static LockFactory getLockFactory()
public static void setLockFactory(LockFactory lockFactory)
LocalLockFactory
.
lockFactory
- the new lock factory to use for creating new Locks.public static Lock getLock(Object key)
Lock
on the specified key or creates a new one if none was found. This
operation should be thread safe. Successive calls with the same key may or may not return
the same Lock
. However, different threads asking for the same Lock at the same time will
get the same Lock object.
key
- the object that defines the visibility or scope of the lock.
|
Openfire 3.4.1 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |