|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.presents.peer.server.PeerManager.LockHandler
protected class PeerManager.LockHandler
Handles a lock in a state of resolution.
| Field Summary | |
|---|---|
protected boolean |
_acquire
|
protected NodeObject.Lock |
_lock
|
protected PeerNode |
_peer
|
protected ArrayIntSet |
_remoids
|
protected long |
_startStamp
|
protected Interval |
_timeout
|
ResultListenerList<String> |
listeners
Listeners waiting for resolution. |
| Constructor Summary | |
|---|---|
PeerManager.LockHandler(NodeObject.Lock lock,
boolean acquire,
ResultListener<String> listener)
Creates a handler to acquire or release a lock for this node. |
|
PeerManager.LockHandler(PeerNode peer,
NodeObject.Lock lock,
boolean acquire)
Creates a handle that tracks another node's acquisition or release of a lock. |
|
| Method Summary | |
|---|---|
protected void |
activate()
Performs the configured action. |
void |
cancel()
Cancels this handler, as another one will be taking its place. |
void |
clientUnsubscribed(int cloid)
Called when a client has unsubscribed from this node (which is waiting for ratification). |
String |
getNodeName()
Returns the name of the node waiting to perform the action. |
boolean |
isAcquiring()
Checks whether we are acquiring as opposed to releasing a lock. |
protected void |
maybeActivate()
Performs the action if all remote nodes have ratified. |
void |
peerAddedLock(String nodeName)
Called to notify us that a node has added the lock. |
void |
peerRemovedLock(String nodeName)
Called to notify us that a node has removed the lock. |
void |
peerUpdatedLock(String nodeName)
Called to notify us that a node has updated the lock. |
void |
ratify(ClientObject caller,
boolean acquire)
Signals that one of the remote nodes has ratified the pending action. |
String |
toString()
|
protected void |
wasActivated(String owner)
Called when the remote node has performed its action. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public ResultListenerList<String> listeners
protected PeerNode _peer
protected NodeObject.Lock _lock
protected boolean _acquire
protected ArrayIntSet _remoids
protected Interval _timeout
protected long _startStamp
| Constructor Detail |
|---|
public PeerManager.LockHandler(NodeObject.Lock lock,
boolean acquire,
ResultListener<String> listener)
public PeerManager.LockHandler(PeerNode peer,
NodeObject.Lock lock,
boolean acquire)
| Method Detail |
|---|
public String getNodeName()
public boolean isAcquiring()
public void ratify(ClientObject caller,
boolean acquire)
public void clientUnsubscribed(int cloid)
public void peerAddedLock(String nodeName)
public void peerUpdatedLock(String nodeName)
public void peerRemovedLock(String nodeName)
public void cancel()
public String toString()
toString in class Objectprotected void maybeActivate()
protected void activate()
protected void wasActivated(String owner)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||