Search in sources :

Example 1 with CacheOperationProvider

use of com.hazelcast.cache.impl.CacheOperationProvider in project hazelcast by hazelcast.

the class CacheGetAllMessageTask method createOperationFactory.

@Override
protected OperationFactory createOperationFactory() {
    CacheOperationProvider operationProvider = getOperationProvider(parameters.name);
    CacheService service = getService(getServiceName());
    ExpiryPolicy expiryPolicy = (ExpiryPolicy) service.toObject(parameters.expiryPolicy);
    Set<Data> keys = new HashSet<Data>(parameters.keys);
    return operationProvider.createGetAllOperationFactory(keys, expiryPolicy);
}
Also used : CacheOperationProvider(com.hazelcast.cache.impl.CacheOperationProvider) ExpiryPolicy(javax.cache.expiry.ExpiryPolicy) Data(com.hazelcast.nio.serialization.Data) CacheService(com.hazelcast.cache.impl.CacheService) HashSet(java.util.HashSet)

Example 2 with CacheOperationProvider

use of com.hazelcast.cache.impl.CacheOperationProvider in project hazelcast by hazelcast.

the class CacheGetAndReplaceMessageTask method prepareOperation.

@Override
protected Operation prepareOperation() {
    CacheOperationProvider operationProvider = getOperationProvider(parameters.name);
    ExpiryPolicy expiryPolicy = (ExpiryPolicy) nodeEngine.toObject(parameters.expiryPolicy);
    return operationProvider.createGetAndReplaceOperation(parameters.key, parameters.value, expiryPolicy, parameters.completionId);
}
Also used : CacheOperationProvider(com.hazelcast.cache.impl.CacheOperationProvider) ExpiryPolicy(javax.cache.expiry.ExpiryPolicy)

Example 3 with CacheOperationProvider

use of com.hazelcast.cache.impl.CacheOperationProvider in project hazelcast by hazelcast.

the class CachePutIfAbsentMessageTask method prepareOperation.

@Override
protected Operation prepareOperation() {
    CacheOperationProvider operationProvider = getOperationProvider(parameters.name);
    ExpiryPolicy expiryPolicy = (ExpiryPolicy) nodeEngine.toObject(parameters.expiryPolicy);
    return operationProvider.createPutIfAbsentOperation(parameters.key, parameters.value, expiryPolicy, parameters.completionId);
}
Also used : CacheOperationProvider(com.hazelcast.cache.impl.CacheOperationProvider) ExpiryPolicy(javax.cache.expiry.ExpiryPolicy)

Example 4 with CacheOperationProvider

use of com.hazelcast.cache.impl.CacheOperationProvider in project hazelcast by hazelcast.

the class CacheRemoveAllKeysMessageTask method createOperationFactory.

@Override
protected OperationFactory createOperationFactory() {
    CacheOperationProvider operationProvider = getOperationProvider(parameters.name);
    Set<Data> keys = new HashSet<Data>(parameters.keys);
    return operationProvider.createRemoveAllOperationFactory(keys, parameters.completionId);
}
Also used : CacheOperationProvider(com.hazelcast.cache.impl.CacheOperationProvider) Data(com.hazelcast.nio.serialization.Data) HashSet(java.util.HashSet)

Example 5 with CacheOperationProvider

use of com.hazelcast.cache.impl.CacheOperationProvider in project hazelcast by hazelcast.

the class CacheReplaceMessageTask method prepareOperation.

@Override
protected Operation prepareOperation() {
    CacheOperationProvider operationProvider = getOperationProvider(parameters.name);
    ExpiryPolicy expiryPolicy = serializationService.toObject(parameters.expiryPolicy);
    return operationProvider.createReplaceOperation(parameters.key, parameters.oldValue, parameters.newValue, expiryPolicy, parameters.completionId);
}
Also used : CacheOperationProvider(com.hazelcast.cache.impl.CacheOperationProvider) ExpiryPolicy(javax.cache.expiry.ExpiryPolicy)

Aggregations

CacheOperationProvider (com.hazelcast.cache.impl.CacheOperationProvider)10 ExpiryPolicy (javax.cache.expiry.ExpiryPolicy)7 Data (com.hazelcast.nio.serialization.Data)4 HashSet (java.util.HashSet)3 CacheService (com.hazelcast.cache.impl.CacheService)2 ArrayList (java.util.ArrayList)1 EntryProcessor (javax.cache.processor.EntryProcessor)1