Package org.jgroups.protocols
Class Locking
java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.Locking
- All Implemented Interfaces:
Lifecycle
- Direct Known Subclasses:
CENTRAL_LOCK,CENTRAL_LOCK2
Deprecated.
See http://belaban.blogspot.com/2020/11/i-hate-distributed-locks.html.
Base locking protocol, handling most of the protocol communication with other instances. To use distributed locking,
LockService is placed on a channel. LockService talks to a subclass of Locking
via events.- Since:
- 2.12
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classDeprecated.protected classDeprecated.Implementation ofLock.protected classDeprecated.Manages access to client locksprotected static classDeprecated.static classDeprecated.static classDeprecated.protected static classDeprecated.A response to a request, to be sent back to the requester as a messageprotected classDeprecated.protected classDeprecated.Server side queue for handling of lock requests (lock, release).static enumDeprecated. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanDeprecated.protected final Locking.ClientLockTableDeprecated.protected static final AtomicIntegerDeprecated.protected final Set<LockNotification> Deprecated.protected Lock[]Deprecated.protected intDeprecated.protected final ConcurrentMap<String, Locking.ServerLock> Deprecated.protected booleanDeprecated.protected ViewDeprecated.Fields inherited from class org.jgroups.stack.Protocol
after_creation_hook, down_prot, ergonomics, id, local_addr, log, policies, stack, stats, up_prot -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LockDeprecated.Gets a lock from locks based on the hash of the lock namevoidaddLockListener(LockNotification listener) Deprecated.booleanDeprecated.bypassBundling(boolean b) Deprecated.protected Locking.ClientLockcreateLock(String lock_name, Owner owner) Deprecated.Deprecated.An event is to be sent down the stack.protected Locking.ClientLockDeprecated.protected Locking.ClientLockDeprecated.intDeprecated.intDeprecated.intDeprecated.protected OwnergetOwner()Deprecated.getView()Deprecated.protected voidhandleAwaitRequest(String lock_name, Owner owner) Deprecated.protected voidhandleCreateAwaitingRequest(String lock_name, Owner owner) Deprecated.protected voidhandleCreateLockRequest(String lock_name, Owner owner) Deprecated.protected voidhandleDeleteAwaitingRequest(String lock_name, Owner owner) Deprecated.protected voidhandleDeleteAwaitRequest(String lock_name, Owner owner) Deprecated.protected voidhandleDeleteLockRequest(String lock_name) Deprecated.protected voidhandleLockDeniedResponse(String lock_name, int lock_id, Owner owner) Deprecated.protected voidhandleLockGrantedResponse(String lock_name, int lock_id, Owner owner) Deprecated.protected voidhandleLockInfoRequest(Address requester) Deprecated.protected voidhandleLockInfoResponse(Address sender, Locking.Request rsp) Deprecated.protected voidhandleLockReleasedResponse(String lock_name, int lock_id, Owner owner) Deprecated.protected voidDeprecated.protected voidDeprecated.protected voidDeprecated.protected voidDeprecated.protected voidhandleSignalResponse(String lock_name, Owner owner) Deprecated.protected voidhandleView(View view) Deprecated.voidinit()Deprecated.Called after a protocol has been created and before the protocol is started.protected voidnotifyAwaited(String lock_name, Owner owner) Deprecated.protected voidnotifyAwaiting(String lock_name, Owner owner) Deprecated.protected voidnotifyLockCreated(String lock_name) Deprecated.protected voidnotifyLockDeleted(String lock_name) Deprecated.protected voidnotifyLocked(String lock_name, Owner owner) Deprecated.protected voidnotifyLockRevoked(String lock_name, Owner current_owner) Deprecated.protected voidnotifyUnlocked(String lock_name, Owner owner) Deprecated.Deprecated.Deprecated.voidremoveLockListener(LockNotification listener) Deprecated.protected voidDeprecated.protected voidsend(Address dest, Locking.Request req) Deprecated.protected abstract voidsendAwaitConditionRequest(String lock_name, Owner owner) Deprecated.protected abstract voidsendDeleteAwaitConditionRequest(String lock_name, Owner owner) Deprecated.protected abstract voidsendGrantLockRequest(String lock_name, int lock_id, Owner owner, long timeout, boolean is_trylock) Deprecated.protected voidsendLockResponse(Locking.Type type, Owner dest, String lock_name, int lock_id) Deprecated.protected abstract voidsendReleaseLockRequest(String lock_name, int lock_id, Owner owner) Deprecated.protected voidsendRequest(Address dest, Locking.Type type, String lock_name, int lock_id, Owner owner, long timeout, boolean is_trylock) Deprecated.protected voidsendRequest(Address dest, Locking.Type type, String lock_name, Owner owner, long timeout, boolean is_trylock) Deprecated.protected abstract voidsendSignalConditionRequest(String lock_name, boolean all) Deprecated.protected voidsendSignalResponse(Owner dest, String lock_name) Deprecated.setLockStripingSize(int l) Deprecated.voidDeprecated.voidunlockForce(String lock_name) Deprecated.Deprecated.An event was received from the protocol below.Deprecated.A single message was received.booleanDeprecated.useThreadIdForLockOwner(boolean u) Deprecated.Methods inherited from class org.jgroups.stack.Protocol
accept, addPolicy, addr, addr, afterCreationHook, destroy, down, down, enableStats, getAddress, getComponents, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getPolicies, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, policies, providedDownServices, providedUpServices, removePolicy, requiredDownServices, requiredUpServices, resetStatistics, resetStats, setAddress, setDownProtocol, setErgonomics, setId, setLevel, setPolicies, setProtocolStack, setSocketFactory, setUpProtocol, setValue, start, statsEnabled, stop, toString, up
-
Field Details
-
bypass_bundling
protected boolean bypass_bundlingDeprecated. -
lock_striping_size
protected int lock_striping_sizeDeprecated. -
use_thread_id_for_lock_owner
protected boolean use_thread_id_for_lock_ownerDeprecated. -
view
Deprecated. -
server_locks
Deprecated. -
lock_stripes
Deprecated. -
client_lock_table
Deprecated. -
lock_listeners
Deprecated. -
current_lock_id
Deprecated.
-
-
Constructor Details
-
Locking
public Locking()Deprecated.
-
-
Method Details
-
bypassBundling
public boolean bypassBundling()Deprecated. -
bypassBundling
Deprecated. -
getLockStripingSize
public int getLockStripingSize()Deprecated. -
setLockStripingSize
Deprecated. -
useThreadIdForLockOwner
public boolean useThreadIdForLockOwner()Deprecated. -
useThreadIdForLockOwner
Deprecated. -
addLockListener
Deprecated. -
removeLockListener
Deprecated. -
getView
Deprecated. -
getNumServerLocks
public int getNumServerLocks()Deprecated. -
getNumClientLocks
public int getNumClientLocks()Deprecated. -
init
Deprecated.Description copied from class:ProtocolCalled after a protocol has been created and before the protocol is started. Attributes are already set. Other protocols are not yet connected and events cannot yet be sent. -
down
Deprecated.Description copied from class:ProtocolAn event is to be sent down the stack. A protocol may want to examine its type and perform some action on it, depending on the event's type. If the event is a message MSG, then the protocol may need to add a header to it (or do nothing at all) before sending it down the stack usingdown_prot.down(). -
up
Deprecated.Description copied from class:ProtocolAn event was received from the protocol below. Usually the current protocol will want to examine the event type and - depending on its type - perform some computation (e.g. removing headers from a MSG event type, or updating the internal membership list when receiving a VIEW_CHANGE event). Finally, the event is either a) discarded, or b) an event is sent down the stack usingdown_prot.down()or c) the event (or another event) is sent up the stack usingup_prot.up(). -
up
Deprecated.Description copied from class:ProtocolA single message was received. Protocols may examine the message and do something (e.g. add a header) with it before passing it up. -
requestReceived
Deprecated. -
handleRequest
Deprecated. -
getLock
Deprecated. -
getLock
Deprecated. -
unlockAll
public void unlockAll()Deprecated. -
unlockForce
Deprecated. -
printLocks
Deprecated. -
printServerLocks
Deprecated. -
handleView
Deprecated. -
createLock
Deprecated. -
_getLock
Deprecated.Gets a lock from locks based on the hash of the lock name -
getOwner
Deprecated. -
sendGrantLockRequest
protected abstract void sendGrantLockRequest(String lock_name, int lock_id, Owner owner, long timeout, boolean is_trylock) Deprecated. -
sendReleaseLockRequest
Deprecated. -
sendAwaitConditionRequest
Deprecated. -
sendSignalConditionRequest
Deprecated. -
sendDeleteAwaitConditionRequest
Deprecated. -
sendRequest
protected void sendRequest(Address dest, Locking.Type type, String lock_name, Owner owner, long timeout, boolean is_trylock) Deprecated. -
sendRequest
protected void sendRequest(Address dest, Locking.Type type, String lock_name, int lock_id, Owner owner, long timeout, boolean is_trylock) Deprecated. -
sendLockResponse
Deprecated. -
sendSignalResponse
Deprecated. -
send
Deprecated. -
handleLockRequest
Deprecated. -
handleLockGrantedResponse
Deprecated. -
handleLockReleasedResponse
Deprecated. -
handleLockDeniedResponse
Deprecated. -
handleLockInfoRequest
Deprecated. -
handleLockInfoResponse
Deprecated. -
handleLockRevoked
Deprecated. -
handleAwaitRequest
Deprecated. -
handleDeleteAwaitRequest
Deprecated. -
handleSignalResponse
Deprecated. -
handleSignalRequest
Deprecated. -
handleCreateLockRequest
Deprecated. -
handleDeleteLockRequest
Deprecated. -
handleCreateAwaitingRequest
Deprecated. -
handleDeleteAwaitingRequest
Deprecated. -
notifyLockCreated
Deprecated. -
notifyLockDeleted
Deprecated. -
notifyLockRevoked
Deprecated. -
notifyLocked
Deprecated. -
notifyUnlocked
Deprecated. -
notifyAwaiting
Deprecated. -
notifyAwaited
Deprecated.
-