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 public abstract class Locking extends Protocol
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:
  • Field Details

    • bypass_bundling

      protected boolean bypass_bundling
      Deprecated.
    • lock_striping_size

      protected int lock_striping_size
      Deprecated.
    • use_thread_id_for_lock_owner

      protected boolean use_thread_id_for_lock_owner
      Deprecated.
    • view

      protected View view
      Deprecated.
    • server_locks

      protected final ConcurrentMap<String,Locking.ServerLock> server_locks
      Deprecated.
    • lock_stripes

      protected Lock[] lock_stripes
      Deprecated.
    • client_lock_table

      protected final Locking.ClientLockTable client_lock_table
      Deprecated.
    • lock_listeners

      protected final Set<LockNotification> lock_listeners
      Deprecated.
    • current_lock_id

      protected static final AtomicInteger current_lock_id
      Deprecated.
  • Constructor Details

    • Locking

      public Locking()
      Deprecated.
  • Method Details

    • bypassBundling

      public boolean bypassBundling()
      Deprecated.
    • bypassBundling

      public Locking bypassBundling(boolean b)
      Deprecated.
    • getLockStripingSize

      public int getLockStripingSize()
      Deprecated.
    • setLockStripingSize

      public Locking setLockStripingSize(int l)
      Deprecated.
    • useThreadIdForLockOwner

      public boolean useThreadIdForLockOwner()
      Deprecated.
    • useThreadIdForLockOwner

      public Locking useThreadIdForLockOwner(boolean u)
      Deprecated.
    • addLockListener

      public void addLockListener(LockNotification listener)
      Deprecated.
    • removeLockListener

      public void removeLockListener(LockNotification listener)
      Deprecated.
    • getView

      public String getView()
      Deprecated.
    • getNumServerLocks

      public int getNumServerLocks()
      Deprecated.
    • getNumClientLocks

      public int getNumClientLocks()
      Deprecated.
    • init

      public void init() throws Exception
      Deprecated.
      Description copied from class: Protocol
      Called 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.
      Specified by:
      init in interface Lifecycle
      Overrides:
      init in class Protocol
      Throws:
      Exception - Thrown if protocol cannot be initialized successfully. This will cause the ProtocolStack to fail, so the the channel constructor will throw an exception
    • down

      public Object down(Event evt)
      Deprecated.
      Description copied from class: Protocol
      An 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 using down_prot.down().
      Overrides:
      down in class Protocol
    • up

      public Object up(Event evt)
      Deprecated.
      Description copied from class: Protocol
      An 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 using down_prot.down() or c) the event (or another event) is sent up the stack using up_prot.up().
      Overrides:
      up in class Protocol
    • up

      public Object up(Message msg)
      Deprecated.
      Description copied from class: Protocol
      A single message was received. Protocols may examine the message and do something (e.g. add a header) with it before passing it up.
      Overrides:
      up in class Protocol
    • requestReceived

      protected void requestReceived(Locking.Request req)
      Deprecated.
    • handleRequest

      protected void handleRequest(Locking.Request req)
      Deprecated.
    • getLock

      protected Locking.ClientLock getLock(String name)
      Deprecated.
    • getLock

      protected Locking.ClientLock getLock(String name, boolean create_if_absent)
      Deprecated.
    • unlockAll

      public void unlockAll()
      Deprecated.
    • unlockForce

      public void unlockForce(String lock_name)
      Deprecated.
    • printLocks

      public String printLocks()
      Deprecated.
    • printServerLocks

      public Object printServerLocks()
      Deprecated.
    • handleView

      protected void handleView(View view)
      Deprecated.
    • createLock

      protected Locking.ClientLock createLock(String lock_name, Owner owner)
      Deprecated.
    • _getLock

      protected Lock _getLock(String lock_name)
      Deprecated.
      Gets a lock from locks based on the hash of the lock name
    • getOwner

      protected Owner getOwner()
      Deprecated.
    • sendGrantLockRequest

      protected abstract void sendGrantLockRequest(String lock_name, int lock_id, Owner owner, long timeout, boolean is_trylock)
      Deprecated.
    • sendReleaseLockRequest

      protected abstract void sendReleaseLockRequest(String lock_name, int lock_id, Owner owner)
      Deprecated.
    • sendAwaitConditionRequest

      protected abstract void sendAwaitConditionRequest(String lock_name, Owner owner)
      Deprecated.
    • sendSignalConditionRequest

      protected abstract void sendSignalConditionRequest(String lock_name, boolean all)
      Deprecated.
    • sendDeleteAwaitConditionRequest

      protected abstract void sendDeleteAwaitConditionRequest(String lock_name, Owner owner)
      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

      protected void sendLockResponse(Locking.Type type, Owner dest, String lock_name, int lock_id)
      Deprecated.
    • sendSignalResponse

      protected void sendSignalResponse(Owner dest, String lock_name)
      Deprecated.
    • send

      protected void send(Address dest, Locking.Request req)
      Deprecated.
    • handleLockRequest

      protected void handleLockRequest(Locking.Request req)
      Deprecated.
    • handleLockGrantedResponse

      protected void handleLockGrantedResponse(String lock_name, int lock_id, Owner owner)
      Deprecated.
    • handleLockReleasedResponse

      protected void handleLockReleasedResponse(String lock_name, int lock_id, Owner owner)
      Deprecated.
    • handleLockDeniedResponse

      protected void handleLockDeniedResponse(String lock_name, int lock_id, Owner owner)
      Deprecated.
    • handleLockInfoRequest

      protected void handleLockInfoRequest(Address requester)
      Deprecated.
    • handleLockInfoResponse

      protected void handleLockInfoResponse(Address sender, Locking.Request rsp)
      Deprecated.
    • handleLockRevoked

      protected void handleLockRevoked(Locking.Request rsp)
      Deprecated.
    • handleAwaitRequest

      protected void handleAwaitRequest(String lock_name, Owner owner)
      Deprecated.
    • handleDeleteAwaitRequest

      protected void handleDeleteAwaitRequest(String lock_name, Owner owner)
      Deprecated.
    • handleSignalResponse

      protected void handleSignalResponse(String lock_name, Owner owner)
      Deprecated.
    • handleSignalRequest

      protected void handleSignalRequest(Locking.Request req)
      Deprecated.
    • handleCreateLockRequest

      protected void handleCreateLockRequest(String lock_name, Owner owner)
      Deprecated.
    • handleDeleteLockRequest

      protected void handleDeleteLockRequest(String lock_name)
      Deprecated.
    • handleCreateAwaitingRequest

      protected void handleCreateAwaitingRequest(String lock_name, Owner owner)
      Deprecated.
    • handleDeleteAwaitingRequest

      protected void handleDeleteAwaitingRequest(String lock_name, Owner owner)
      Deprecated.
    • notifyLockCreated

      protected void notifyLockCreated(String lock_name)
      Deprecated.
    • notifyLockDeleted

      protected void notifyLockDeleted(String lock_name)
      Deprecated.
    • notifyLockRevoked

      protected void notifyLockRevoked(String lock_name, Owner current_owner)
      Deprecated.
    • notifyLocked

      protected void notifyLocked(String lock_name, Owner owner)
      Deprecated.
    • notifyUnlocked

      protected void notifyUnlocked(String lock_name, Owner owner)
      Deprecated.
    • notifyAwaiting

      protected void notifyAwaiting(String lock_name, Owner owner)
      Deprecated.
    • notifyAwaited

      protected void notifyAwaited(String lock_name, Owner owner)
      Deprecated.