net.sf.sasl.distributed.lock.hazelcast
Class HazelcastLockProvider
java.lang.Object
net.sf.sasl.distributed.lock.hazelcast.HazelcastLockProvider
- All Implemented Interfaces:
- ILockProvider
public class HazelcastLockProvider
- extends Object
- implements ILockProvider
Adapter which provides lock operations via hazelcast. Hazelcast can currently
not detect deadlocks.
- Since:
- 0.0.1 (sasl-distributed-lock-library)
- Author:
- Philipp Förmer
Method Summary |
IMutex |
acquireMutex(Object lockKey)
Acquires a mutex for the given lock key at the lock provider and returns
it. |
com.hazelcast.core.HazelcastInstance |
getHazelcastInstance()
|
void |
setHazelcastInstance(com.hazelcast.core.HazelcastInstance hazelcastInstance)
Sets a hazelcast instance (=the adapted class) over which lock support
will be provided. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HazelcastLockProvider
public HazelcastLockProvider()
getHazelcastInstance
public com.hazelcast.core.HazelcastInstance getHazelcastInstance()
- Returns:
- null or non null
- Since:
- 0.0.1 (sasl-distributed-lock-library)
- See Also:
setHazelcastInstance(HazelcastInstance)
setHazelcastInstance
public void setHazelcastInstance(com.hazelcast.core.HazelcastInstance hazelcastInstance)
throws IllegalArgumentException
- Sets a hazelcast instance (=the adapted class) over which lock support
will be provided.
- Parameters:
hazelcastInstance
- non null
- Throws:
IllegalArgumentException
- if hazelcastInstance is null.- Since:
- 0.0.1 (sasl-distributed-lock-library)
acquireMutex
public IMutex acquireMutex(Object lockKey)
- Description copied from interface:
ILockProvider
- Acquires a mutex for the given lock key at the lock provider and returns
it.
- Specified by:
acquireMutex
in interface ILockProvider
- Parameters:
lockKey
- null or non null
- Returns:
- non null
- Since:
- 0.0.1 (sasl-distributed-lock-library)
- See Also:
ILockProvider.acquireMutex(java.lang.Object)
Copyright © 2010. All Rights Reserved.