com.hazelcast.concurrent.lock
Class LockStoreImpl

java.lang.Object
  extended by com.hazelcast.concurrent.lock.LockStoreImpl
All Implemented Interfaces:
LockStore, DataSerializable

public final class LockStoreImpl
extends Object
implements DataSerializable, LockStore


Constructor Summary
LockStoreImpl()
           
LockStoreImpl(LockServiceImpl lockService, ObjectNamespace name, int backupCount, int asyncBackupCount)
           
 
Method Summary
 boolean addAwait(Data key, String conditionId, String caller, long threadId)
           
 boolean canAcquireLock(Data key, String caller, long threadId)
           
 void clear()
           
 boolean extendLeaseTime(Data key, String caller, long threadId, long leaseTime)
           
 boolean forceUnlock(Data key)
           
 int getAsyncBackupCount()
           
 int getAwaitCount(Data key, String conditionId)
           
 int getBackupCount()
           
 int getLockCount(Data key)
           
 Set<Data> getLockedKeys()
           
 Collection<LockResource> getLocks()
           
 ObjectNamespace getNamespace()
           
 String getOwnerInfo(Data key)
           
 long getRemainingLeaseTime(Data key)
           
 ConditionKey getSignalKey(Data key)
           
 int getTotalBackupCount()
           
 int getVersion(Data key)
           
 boolean isLocked(Data key)
           
 boolean isLockedBy(Data key, String caller, long threadId)
           
 boolean isTransactionallyLocked(Data key)
           
 boolean lock(Data key, String caller, long threadId)
           
 boolean lock(Data key, String caller, long threadId, long leaseTime)
           
 AwaitOperation pollExpiredAwaitOp(Data key)
           
 void readData(ObjectDataInput in)
          Reads fields from the input stream
 void registerExpiredAwaitOp(AwaitOperation awaitResponse)
           
 void registerSignalKey(ConditionKey conditionKey)
           
 boolean removeAwait(Data key, String conditionId, String caller, long threadId)
           
 void removeSignalKey(ConditionKey conditionKey)
           
 boolean startAwaiting(Data key, String conditionId, String caller, long threadId)
           
 String toString()
           
 boolean txnLock(Data key, String caller, long threadId, long leaseTime)
           
 boolean unlock(Data key, String caller, long threadId)
           
 void writeData(ObjectDataOutput out)
          Writes object fields to output stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LockStoreImpl

public LockStoreImpl()

LockStoreImpl

public LockStoreImpl(LockServiceImpl lockService,
                     ObjectNamespace name,
                     int backupCount,
                     int asyncBackupCount)
Method Detail

lock

public boolean lock(Data key,
                    String caller,
                    long threadId)

lock

public boolean lock(Data key,
                    String caller,
                    long threadId,
                    long leaseTime)
Specified by:
lock in interface LockStore

txnLock

public boolean txnLock(Data key,
                       String caller,
                       long threadId,
                       long leaseTime)
Specified by:
txnLock in interface LockStore

extendLeaseTime

public boolean extendLeaseTime(Data key,
                               String caller,
                               long threadId,
                               long leaseTime)
Specified by:
extendLeaseTime in interface LockStore

isLocked

public boolean isLocked(Data key)
Specified by:
isLocked in interface LockStore

isLockedBy

public boolean isLockedBy(Data key,
                          String caller,
                          long threadId)
Specified by:
isLockedBy in interface LockStore

getLockCount

public int getLockCount(Data key)
Specified by:
getLockCount in interface LockStore

getRemainingLeaseTime

public long getRemainingLeaseTime(Data key)
Specified by:
getRemainingLeaseTime in interface LockStore

canAcquireLock

public boolean canAcquireLock(Data key,
                              String caller,
                              long threadId)
Specified by:
canAcquireLock in interface LockStore

isTransactionallyLocked

public boolean isTransactionallyLocked(Data key)
Specified by:
isTransactionallyLocked in interface LockStore

unlock

public boolean unlock(Data key,
                      String caller,
                      long threadId)
Specified by:
unlock in interface LockStore

forceUnlock

public boolean forceUnlock(Data key)
Specified by:
forceUnlock in interface LockStore

getVersion

public int getVersion(Data key)

getLocks

public Collection<LockResource> getLocks()

getLockedKeys

public Set<Data> getLockedKeys()
Specified by:
getLockedKeys in interface LockStore

clear

public void clear()

getNamespace

public ObjectNamespace getNamespace()

getBackupCount

public int getBackupCount()

getAsyncBackupCount

public int getAsyncBackupCount()

getTotalBackupCount

public int getTotalBackupCount()

addAwait

public boolean addAwait(Data key,
                        String conditionId,
                        String caller,
                        long threadId)

removeAwait

public boolean removeAwait(Data key,
                           String conditionId,
                           String caller,
                           long threadId)

startAwaiting

public boolean startAwaiting(Data key,
                             String conditionId,
                             String caller,
                             long threadId)

getAwaitCount

public int getAwaitCount(Data key,
                         String conditionId)

registerSignalKey

public void registerSignalKey(ConditionKey conditionKey)

getSignalKey

public ConditionKey getSignalKey(Data key)

removeSignalKey

public void removeSignalKey(ConditionKey conditionKey)

registerExpiredAwaitOp

public void registerExpiredAwaitOp(AwaitOperation awaitResponse)

pollExpiredAwaitOp

public AwaitOperation pollExpiredAwaitOp(Data key)

getOwnerInfo

public String getOwnerInfo(Data key)
Specified by:
getOwnerInfo in interface LockStore

writeData

public void writeData(ObjectDataOutput out)
               throws IOException
Description copied from interface: DataSerializable
Writes object fields to output stream

Specified by:
writeData in interface DataSerializable
Parameters:
out - output
Throws:
IOException

readData

public void readData(ObjectDataInput in)
              throws IOException
Description copied from interface: DataSerializable
Reads fields from the input stream

Specified by:
readData in interface DataSerializable
Parameters:
in - input
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.