Package org.jgroups.protocols
Class Locking.ServerLock
- java.lang.Object
-
- org.jgroups.protocols.Locking.ServerLock
-
- Enclosing class:
- Locking
protected class Locking.ServerLock extends java.lang.Object
Server side queue for handling of lock requests (lock, release).- Author:
- Bela Ban
-
-
Field Summary
Fields Modifier and Type Field Description protected Locking.ServerCondition
condition
protected java.lang.String
lock_name
protected Owner
owner
protected java.util.List<Locking.Request>
queue
-
Constructor Summary
Constructors Modifier Constructor Description ServerLock(java.lang.String lock_name)
protected
ServerLock(java.lang.String lock_name, Owner owner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addToQueue(Locking.Request req)
protected Locking.Request
getNextRequest()
protected Locking.Response
handleRequest(Locking.Request req)
protected Locking.Response
handleView(java.util.List<Address> members)
boolean
isEmpty()
protected boolean
isRequestPresent(Locking.Type type, Owner owner)
Checks if a certain request from a given owner is already in the queueprotected Locking.Response
processQueue()
protected void
removeRequest(Locking.Type type, Owner owner)
protected void
setOwner(Owner owner)
java.lang.String
toString()
-
-
-
Field Detail
-
lock_name
protected final java.lang.String lock_name
-
owner
protected Owner owner
-
queue
protected final java.util.List<Locking.Request> queue
-
condition
protected final Locking.ServerCondition condition
-
-
Constructor Detail
-
ServerLock
public ServerLock(java.lang.String lock_name)
-
ServerLock
protected ServerLock(java.lang.String lock_name, Owner owner)
-
-
Method Detail
-
handleRequest
protected Locking.Response handleRequest(Locking.Request req)
-
handleView
protected Locking.Response handleView(java.util.List<Address> members)
-
addToQueue
protected void addToQueue(Locking.Request req)
-
isRequestPresent
protected boolean isRequestPresent(Locking.Type type, Owner owner)
Checks if a certain request from a given owner is already in the queue
-
removeRequest
protected void removeRequest(Locking.Type type, Owner owner)
-
getNextRequest
protected Locking.Request getNextRequest()
-
processQueue
protected Locking.Response processQueue()
-
setOwner
protected void setOwner(Owner owner)
-
isEmpty
public boolean isEmpty()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-