Search in sources :

Example 6 with CacheOperationProvider

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

the class CacheEntryProcessorMessageTask method prepareOperation.

@Override
protected Operation prepareOperation() {
    CacheService service = getService(getServiceName());
    CacheOperationProvider operationProvider = getOperationProvider(parameters.name);
    EntryProcessor entryProcessor = (EntryProcessor) service.toObject(parameters.entryProcessor);
    ArrayList argumentsList = new ArrayList(parameters.arguments.size());
    for (Data data : parameters.arguments) {
        argumentsList.add(service.toObject(data));
    }
    return operationProvider.createEntryProcessorOperation(parameters.key, parameters.completionId, entryProcessor, argumentsList.toArray());
}
Also used : EntryProcessor(javax.cache.processor.EntryProcessor) CacheOperationProvider(com.hazelcast.cache.impl.CacheOperationProvider) ArrayList(java.util.ArrayList) Data(com.hazelcast.nio.serialization.Data) CacheService(com.hazelcast.cache.impl.CacheService)

Example 7 with CacheOperationProvider

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

the class CacheGetMessageTask method prepareOperation.

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

Example 8 with CacheOperationProvider

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

the class CacheLoadAllMessageTask method createOperationFactory.

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

Example 9 with CacheOperationProvider

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

the class CachePutAllMessageTask method prepareOperation.

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

Example 10 with CacheOperationProvider

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

the class CachePutMessageTask method prepareOperation.

@Override
protected Operation prepareOperation() {
    CacheOperationProvider operationProvider = getOperationProvider(parameters.name);
    ExpiryPolicy expiryPolicy = (ExpiryPolicy) nodeEngine.toObject(parameters.expiryPolicy);
    return operationProvider.createPutOperation(parameters.key, parameters.value, expiryPolicy, parameters.get, 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