Package org.infinispan.util.concurrent

Examples of org.infinispan.util.concurrent.NotifyingFutureImpl


               if (trace) log.trace("Invoking command {0} on hosts {1}", command, rec);
               boolean useFuture = ctx.isUseFutureReturnType();
               boolean sync = isSynchronous(ctx);
               NotifyingNotifiableFuture<Object> future = flushL1Cache(rec == null ? 0 : rec.size(), recipientGenerator.getKeys(), returnValue);
               if (useFuture) {
                  if (future == null) future = new NotifyingFutureImpl(returnValue);
                  rpcManager.invokeRemotelyInFuture(rec, command, future);
                  return future;
               } else {
                  rpcManager.invokeRemotely(rec, command, sync);
                  if (future != null && !sync) future.get(); // wait for the inval command to complete
View Full Code Here


      // FIRST pass this call up the chain.  Only if it succeeds (no exceptions) locally do we attempt to replicate.
      final Object returnValue = invokeNextInterceptor(ctx, command);
      populateCommandFlags(command, ctx);
      if (!isLocalModeForced(ctx) && command.isSuccessful() && ctx.isOriginLocal() && !ctx.isInTxScope()) {
         if (ctx.isUseFutureReturnType()) {
            NotifyingNotifiableFuture<Object> future = new NotifyingFutureImpl(returnValue);
            rpcManager.broadcastRpcCommandInFuture(command, future);
            return future;
         } else {
            rpcManager.broadcastRpcCommand(command, isSynchronous(ctx));
         }
View Full Code Here

                 } else {
                     if (trace) log.tracef("Not performing invalidation! numCallRecipients=%s", numCallRecipients);
                  }
               if (!isSingleOwnerAndLocal(recipientGenerator)) {
                  if (useFuture) {
                     if (futureToReturn == null) futureToReturn = new NotifyingFutureImpl(returnValue);
                     rpcManager.invokeRemotelyInFuture(rec, command, futureToReturn);
                     return futureToReturn;
                  } else {
                     rpcManager.invokeRemotely(rec, command, sync);
                  }
View Full Code Here

   private Object handleCrudMethod(final InvocationContext ctx, final WriteCommand command) throws Throwable {
      // FIRST pass this call up the chain.  Only if it succeeds (no exceptions) locally do we attempt to replicate.
      final Object returnValue = invokeNextInterceptor(ctx, command);
      if (!isLocalModeForced(command) && command.isSuccessful() && ctx.isOriginLocal() && !ctx.isInTxScope()) {
         if (ctx.isUseFutureReturnType()) {
            NotifyingNotifiableFuture<Object> future = new NotifyingFutureImpl(returnValue);
            rpcManager.broadcastRpcCommandInFuture(command, future);
            return future;
         } else {
            rpcManager.broadcastRpcCommand(command, isSynchronous(command));
         }
View Full Code Here

      final InvalidateCommand command = commandsFactory.buildInvalidateCommand(Collections.<Flag>emptySet(), keys);
      if (log.isDebugEnabled())
         log.debug("Cache [" + rpcManager.getTransport().getAddress() + "] replicating " + command);
      // voila, invalidated!
      if (useFuture) {
         NotifyingNotifiableFuture<Object> future = new NotifyingFutureImpl(retvalForFuture);
         rpcManager.broadcastRpcCommandInFuture(command, future);
         return future;
      } else {
         rpcManager.broadcastRpcCommand(command, synchronous);
      }
View Full Code Here

                 } else {
                     if (trace) log.tracef("Not performing invalidation! numCallRecipients=%s", numCallRecipients);
                  }
               if (!isSingleOwnerAndLocal(recipientGenerator)) {
                  if (useFuture) {
                     if (futureToReturn == null) futureToReturn = new NotifyingFutureImpl(returnValue);
                     rpcManager.invokeRemotelyInFuture(rec, command, futureToReturn);
                     return futureToReturn;
                  } else {
                     rpcManager.invokeRemotely(rec, command, sync);
                  }
View Full Code Here

               });
            }
         }
      } else {
         if (trace) log.trace("No L1 caches to invalidate");
         return useNotifyingFuture ? new NotifyingFutureImpl(retval) : new NoOpFuture<Object>(retval);
      }
   }
View Full Code Here

                 } else {
                     if (trace) log.tracef("Not performing invalidation! numCallRecipients=%s", numCallRecipients);
                  }
               if (!isSingleOwnerAndLocal(recipientGenerator)) {
                  if (useFuture) {
                     if (future == null) future = new NotifyingFutureImpl(returnValue);
                     rpcManager.invokeRemotelyInFuture(rec, command, future);
                     return future;
                  } else {
                     rpcManager.invokeRemotely(rec, command, sync);
                  }
View Full Code Here

      populateCommandFlags(command, ctx);
      if (!isLocalModeForced(ctx) && command.isSuccessful() && ctx.isOriginLocal() && !ctx.isInTxScope()) {
         stateTransferLock.waitForStateTransferToEnd(ctx, command, -1);

         if (ctx.isUseFutureReturnType()) {
            NotifyingNotifiableFuture<Object> future = new NotifyingFutureImpl(returnValue);
            rpcManager.broadcastRpcCommandInFuture(command, future);
            return future;
         } else {
            rpcManager.broadcastRpcCommand(command, isSynchronous(ctx));
         }
View Full Code Here

                 } else {
                     if (trace) log.tracef("Not performing invalidation! numCallRecipients=%s", numCallRecipients);
                  }
               if (!isSingleOwnerAndLocal(recipientGenerator)) {
                  if (useFuture) {
                     if (futureToReturn == null) futureToReturn = new NotifyingFutureImpl(returnValue);
                     rpcManager.invokeRemotelyInFuture(rec, command, futureToReturn);
                     return futureToReturn;
                  } else {
                     rpcManager.invokeRemotely(rec, command, sync);
                  }
View Full Code Here

TOP

Related Classes of org.infinispan.util.concurrent.NotifyingFutureImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.