public class DistributedLockManager extends Object implements LockManager, LockCommandContext, Stateful, MembershipListener
| Constructor and Description |
|---|
DistributedLockManager(DatabaseCluster<Z,D> cluster,
CommandDispatcherFactory dispatcherFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
added(Member member)
Indicates that the specified member was added to the group.
|
Lock |
getDistibutedLock(RemoteLockDescriptor descriptor) |
Lock |
getLock(LockDescriptor lock) |
Map<LockDescriptor,Lock> |
getRemoteLocks(Remote remote) |
Lock |
readLock(String id)
Obtains a named read lock.
|
void |
readState(ObjectInput input)
Returns the state of this object.
|
void |
removed(Member member)
Indicates the the specified member was removed from the group.
|
void |
start()
Called upon database cluster start.
|
void |
stop()
Called when database cluster is stopped.
|
Lock |
writeLock(String id)
Obtains a named write lock.
|
void |
writeState(ObjectOutput output)
Sets the state of this object.
|
public DistributedLockManager(DatabaseCluster<Z,D> cluster, CommandDispatcherFactory dispatcherFactory) throws Exception
Exceptionpublic Lock readLock(String id)
readLock in interface LockManagerid - an object to lockLockManager.readLock(java.lang.String)public Lock writeLock(String id)
writeLock in interface LockManagerid - an object to lockLockManager.writeLock(java.lang.String)public Lock getLock(LockDescriptor lock)
getLock in interface LockCommandContextLockCommandContext.getLock(net.sf.hajdbc.lock.distributed.LockDescriptor)public Lock getDistibutedLock(RemoteLockDescriptor descriptor)
getDistibutedLock in interface LockCommandContextLockCommandContext.getDistibutedLock(net.sf.hajdbc.lock.distributed.RemoteLockDescriptor)public void start() throws Exception
start in interface LifecycleException - if this service fails to start.Lifecycle.start()public void stop()
stop in interface LifecycleLifecycle.stop()public Map<LockDescriptor,Lock> getRemoteLocks(Remote remote)
getRemoteLocks in interface LockCommandContextLockCommandContext.getRemoteLocks(net.sf.hajdbc.distributed.Remote)public void writeState(ObjectOutput output) throws IOException
writeState in interface StatefulIOExceptionStateful.writeState(java.io.ObjectOutput)public void readState(ObjectInput input) throws IOException
readState in interface StatefulIOExceptionStateful.readState(java.io.ObjectInput)public void added(Member member)
added in interface MembershipListenermember - the added memberMembershipListener.added(net.sf.hajdbc.distributed.Member)public void removed(Member member)
removed in interface MembershipListenermember - the removed memberMembershipListener.removed(net.sf.hajdbc.distributed.Member)Copyright © 2004–2014 Paul Ferraro. All rights reserved.