Search in sources :

Example 1 with RemoteLockCommand

use of org.infinispan.util.concurrent.locks.RemoteLockCommand in project infinispan by infinispan.

the class SingleRpcCommand method invokeAsync.

@Override
public CompletionStage<?> invokeAsync(ComponentRegistry componentRegistry) throws Throwable {
    command.init(componentRegistry);
    InvocationContextFactory icf = componentRegistry.getInvocationContextFactory().running();
    InvocationContext ctx = icf.createRemoteInvocationContextForCommand(command, getOrigin());
    if (command instanceof RemoteLockCommand) {
        ctx.setLockOwner(((RemoteLockCommand) command).getKeyLockOwner());
    }
    if (log.isTraceEnabled())
        log.tracef("Invoking command %s, with originLocal flag set to %b", command, ctx.isOriginLocal());
    return componentRegistry.getInterceptorChain().running().invokeAsync(ctx, command);
}
Also used : RemoteLockCommand(org.infinispan.util.concurrent.locks.RemoteLockCommand) InvocationContext(org.infinispan.context.InvocationContext) InvocationContextFactory(org.infinispan.context.InvocationContextFactory)

Example 2 with RemoteLockCommand

use of org.infinispan.util.concurrent.locks.RemoteLockCommand in project infinispan by infinispan.

the class BaseLockingAction method getAndUpdateFilteredKeys.

protected final List<Object> getAndUpdateFilteredKeys(ActionState state) {
    List<Object> filteredKeys = state.getFilteredKeys();
    if (filteredKeys == null) {
        RemoteLockCommand remoteLockCommand = state.getCommand();
        Collection<?> rawKeys = remoteLockCommand.getKeysToLock();
        filteredKeys = new ArrayList<>(rawKeys.size());
        filterByLockOwner(rawKeys, filteredKeys);
        state.updateFilteredKeys(filteredKeys);
    }
    return filteredKeys;
}
Also used : RemoteLockCommand(org.infinispan.util.concurrent.locks.RemoteLockCommand)

Aggregations

RemoteLockCommand (org.infinispan.util.concurrent.locks.RemoteLockCommand)2 InvocationContext (org.infinispan.context.InvocationContext)1 InvocationContextFactory (org.infinispan.context.InvocationContextFactory)1