Examples of SuccessfulResponse


Examples of org.infinispan.remoting.responses.SuccessfulResponse

      if (!responses.isEmpty()) {
         for (Response r : responses.values()) {
            if (r instanceof SuccessfulResponse) {

               // The response value might be null.
               SuccessfulResponse response = (SuccessfulResponse) r;
               Object responseValue = response.getResponseValue();
               if (responseValue == null) {
                  continue;
               }

               InternalCacheValue cacheValue = (InternalCacheValue) responseValue;
View Full Code Here

Examples of org.infinispan.remoting.responses.SuccessfulResponse

      command.setVersionsSeen(vs);
   }

   public static void readVersionsFromResponse(Response r, CacheTransaction ct) {
      if (r != null && r.isSuccessful()) {
         SuccessfulResponse sr = (SuccessfulResponse) r;
         EntryVersionsMap uv = (EntryVersionsMap) sr.getResponseValue();
         if (uv != null) ct.setUpdatedEntryVersions(uv.merge(ct.getUpdatedEntryVersions()));
      }
   }
View Full Code Here

Examples of org.infinispan.remoting.responses.SuccessfulResponse

      command.setVersionsSeen(vs);
   }

   public static void readVersionsFromResponse(Response r, CacheTransaction ct) {
      if (r != null && r.isSuccessful()) {
         SuccessfulResponse sr = (SuccessfulResponse) r;
         EntryVersionsMap uv = (EntryVersionsMap) sr.getResponseValue();
         if (uv != null) ct.setUpdatedEntryVersions(uv.merge(ct.getUpdatedEntryVersions()));
      }
   }
View Full Code Here

Examples of org.infinispan.remoting.responses.SuccessfulResponse

      if (!responses.isEmpty()) {
         for (Response r : responses.values()) {
            if (r instanceof SuccessfulResponse) {
              
               // The response value might be null.
               SuccessfulResponse response = (SuccessfulResponse)r;
               if( response.getResponseValue() == null )
                  return null;
              
               InternalCacheValue cacheValue = (InternalCacheValue) response.getResponseValue();
               return cacheValue.toInternalCacheEntry(key);
            }
         }
      }
View Full Code Here

Examples of org.infinispan.remoting.responses.SuccessfulResponse

      if (!rpcManager.getTransport().isCoordinator()) {
         Map<Address, Response> resps = rpcManager.invokeRemotely(null, command, true, true);
         Response r = resps.get(rpcManager.getTransport().getCoordinator())// We only really care about the coordinator's response.
         CacheTransaction ct = context.getCacheTransaction();
         if (r.isSuccessful()) {
            SuccessfulResponse sr = (SuccessfulResponse) r;
            EntryVersionsMap uv = (EntryVersionsMap) sr.getResponseValue();
            ct.setUpdatedEntryVersions(uv);
         }
      } else {
         super.broadcastPrepare(context, command);
      }
View Full Code Here

Examples of org.infinispan.remoting.responses.SuccessfulResponse

      // Now store newly generated versions from lock owners for use during the commit phase.
      CacheTransaction ct = ctx.getCacheTransaction();
      for (Response r : resps.values()) {
         if (r != null && r.isSuccessful()) {
            SuccessfulResponse sr = (SuccessfulResponse) r;
            EntryVersionsMap uv = (EntryVersionsMap) sr.getResponseValue();
            if (uv != null) ct.setUpdatedEntryVersions(uv.merge(ct.getUpdatedEntryVersions()));
         }
      }
   }
View Full Code Here

Examples of org.infinispan.remoting.responses.SuccessfulResponse

               DUMMY_CACHE_NAME_FOR_GLOBAL_COMMANDS, CacheViewControlCommand.Type.RECOVER_VIEW, self);
         Map<Address, Response> rspList = transport.invokeRemotely(null, cmd,
               ResponseMode.SYNCHRONOUS_IGNORE_LEAVERS, timeout, true, null, false);
         checkRemoteResponse(null, cmd, rspList);
         for (Map.Entry<Address, Response> e : rspList.entrySet()) {
            SuccessfulResponse value = (SuccessfulResponse) e.getValue();
            recoveryInfo.put(e.getKey(), (Map<String, CacheView>) value.getResponseValue());
         }

         // get the full set of caches
         Set<String> cacheNames = new HashSet<String>();
         for (Map<String, CacheView> m : recoveryInfo.values()) {
View Full Code Here

Examples of org.infinispan.remoting.responses.SuccessfulResponse

      // TODO Support global commands separately
      if (cmd instanceof CacheViewControlCommand) {
         ((CacheViewControlCommand) cmd).init(cacheViewsManager);
         try {
            return new SuccessfulResponse(cmd.perform(null));
         } catch (Exception e) {
            return new ExceptionResponse(e);
         }
      }
View Full Code Here

Examples of org.infinispan.remoting.responses.SuccessfulResponse

               Map<Address,Response> rspMap = new HashMap<Address, Response>();
               Object result = null;
               future.getCommand().init(cache);
               try {
                  result = future.getCommand().perform(null);
                  rspMap.put(rpc.getAddress(), new SuccessfulResponse(result));
                  result = rspMap;
               } catch (Throwable e) {
                  result = e;
               } finally {
                  future.notifyDone();
View Full Code Here

Examples of org.infinispan.remoting.responses.SuccessfulResponse

            return RequestIgnoredResponse.INSTANCE;
         case MAGICNUMBER_UNSUCCESSFUL_RESPONSE:
            return UnsuccessfulResponse.INSTANCE;
         case MAGICNUMBER_SUCCESSFUL_RESPONSE:
            Object retval = unmarshallObject(in, refMap);
            return new SuccessfulResponse(retval);
         case MAGICNUMBER_EXCEPTION_RESPONSE:
            Exception e = (Exception) unmarshallObject(in, refMap);
            return new ExceptionResponse(e);
         case MAGICNUMBER_EXTENDED_RESPONSE:
            boolean replay = in.readBoolean();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.