Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SessionLockImpl

Implementation of the SessionLock interface

Hierarchy

  • SessionLockImpl

Implements

Index

Constructors

constructor

Properties

Private acquisition

The session lock acquisition

Private owned

owned: boolean = true

Flag indicating if the session lock is owned

Private unlockSessionLock

unlockSessionLock: function

The service to request release of the lock

Type declaration

Methods

getName

  • getName(): string
  • Get the name of the lock

    Returns string

    the name of the session lock

getScope

  • The scope of the lock.

    The scope determines when the lock will be released automatically.

    If a session makes multiple requests for a lock using different scopes, and the server assigns the lock to the session fulfilling the requests, the lock will be given the weakest scope (UNLOCK_ON_CONNECTION_LOSS). Consequently, an individual request can complete with a lock that has a different scope to that requested.

    see

    Session.lock

    Returns SessionLockScope

    the lock scope

getSequence

  • getSequence(): Long
  • A value that identifies the acquisition of the lock with the given name. SessionLocks that are acquired later are guaranteed to have bigger sequence values, allowing the sequence number to be used as a fencing token.

    Returns Long

    a value that identifies the acquisition of this lock

isOwned

  • isOwned(): boolean
  • Test whether the session lock is still owned.

    Returns boolean

    true if the session lock is still owned by the session

toString

  • toString(): string
  • Convert the SessionLockImpl to a string

    Returns string

    the string representation of the session lock

unlock

  • Release a session lock, if owned.

    see

    Session.lock

    Returns Result<boolean>

    a Promise that resolves when a response is received from the server.

    On completion, this session will no longer own the named session lock. If Promise completes normally, a true value indicates this session previously owned the lock and a false value indicates it did not.

    If the Promise resolves with an error, this session does not own the session lock.