Search in sources :

Example 6 with ClientEngine

use of com.hazelcast.client.impl.ClientEngine in project hazelcast by hazelcast.

the class LockOperation method run.

@Override
public void run() throws Exception {
    interceptLockOperation();
    if (isClient) {
        ClientEngine clientEngine = getNodeEngine().getService(ClientEngineImpl.SERVICE_NAME);
        clientEngine.onClientAcquiredResource(getCallerUuid());
    }
    final boolean lockResult = getLockStore().lock(key, getCallerUuid(), threadId, getReferenceCallId(), leaseTime);
    response = lockResult;
    ILogger logger = getLogger();
    if (logger.isFinestEnabled()) {
        if (lockResult) {
            logger.finest("Acquired lock " + namespace.getObjectName() + " for " + getCallerAddress() + " - " + getCallerUuid() + ", thread ID: " + threadId);
        } else {
            logger.finest("Could not acquire lock " + namespace.getObjectName() + " as owned by " + getLockStore().getOwnerInfo(key));
        }
    }
}
Also used : ClientEngine(com.hazelcast.client.impl.ClientEngine) ILogger(com.hazelcast.logging.ILogger)

Example 7 with ClientEngine

use of com.hazelcast.client.impl.ClientEngine in project hazelcast by hazelcast.

the class LockBackupOperation method run.

@Override
public void run() throws Exception {
    if (isClient) {
        ClientEngine clientEngine = getNodeEngine().getService(ClientEngineImpl.SERVICE_NAME);
        clientEngine.onClientAcquiredResource(originalCallerUuid);
    }
    interceptLockOperation();
    LockStoreImpl lockStore = getLockStore();
    response = lockStore.lock(key, originalCallerUuid, threadId, getReferenceCallId(), leaseTime);
}
Also used : LockStoreImpl(com.hazelcast.internal.locksupport.LockStoreImpl) ClientEngine(com.hazelcast.client.impl.ClientEngine)

Aggregations

ClientEngine (com.hazelcast.client.impl.ClientEngine)7 Client (com.hazelcast.client.Client)2 UUID (java.util.UUID)2 ClientEndpointImpl (com.hazelcast.client.impl.ClientEndpointImpl)1 ClientEndpointStatisticsSnapshot (com.hazelcast.client.impl.ClientEndpointStatisticsSnapshot)1 ClientExceptionFactory (com.hazelcast.client.impl.protocol.ClientExceptionFactory)1 ClientStatistics (com.hazelcast.client.impl.statistics.ClientStatistics)1 LockStoreImpl (com.hazelcast.internal.locksupport.LockStoreImpl)1 MetricDescriptor (com.hazelcast.internal.metrics.MetricDescriptor)1 CapturingCollector (com.hazelcast.internal.metrics.impl.CapturingCollector)1 MetricsService (com.hazelcast.internal.metrics.impl.MetricsService)1 TaskletExecutionService (com.hazelcast.jet.impl.execution.TaskletExecutionService)1 JobMetricsPublisher (com.hazelcast.jet.impl.metrics.JobMetricsPublisher)1 ILogger (com.hazelcast.logging.ILogger)1 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)1 OperationServiceImpl (com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl)1