Examples of SuccessfulResponse


Examples of org.infinispan.remoting.responses.SuccessfulResponse

      SuccessfulResponse sr = (SuccessfulResponse) subject;
      output.writeObject(sr.getResponseValue());     
   }

   public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
      SuccessfulResponse sr = new SuccessfulResponse();
      sr.setResponseValue(input.readObject());
      return sr;
   }
View Full Code Here

Examples of org.infinispan.remoting.responses.SuccessfulResponse

   }

   private void updateTopologyInfo(Collection<Response> responses) {
      for (Response r : responses) {
         if (r instanceof SuccessfulResponse) {
            SuccessfulResponse sr = (SuccessfulResponse) r;
            NodeTopologyInfo nti = (NodeTopologyInfo) sr.getResponseValue();
            if (nti != null) {
               distributionManager.getTopologyInfo().addNodeTopologyInfo(nti.getAddress(), nti);
            }
         } else {
            // will ignore unsuccessful response
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

         for (Future<Map<Address, Response>> future : futures) {
            rspList.putAll(future.get());
         }
         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

            public Object call() throws Exception {
               Object result = null;
               future.getCommand().init(cache);
               try {
                  result = future.getCommand().perform(null);
                  return Collections.singletonMap(rpc.getAddress(), new SuccessfulResponse(result));
               } catch (Throwable e) {
                  return e;
               } finally {
                  future.notifyDone();
               }
View Full Code Here

Examples of org.infinispan.remoting.responses.SuccessfulResponse

         for (Future<Map<Address, Response>> future : futures) {
            rspList.putAll(future.get());
         }
         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

            public Object call() throws Exception {
               Object result = null;
               future.getCommand().init(cache);
               try {
                  result = future.getCommand().perform(null);
                  return Collections.singletonMap(rpc.getAddress(), new SuccessfulResponse(result));
               } catch (Throwable e) {
                  return e;
               } finally {
                  future.notifyDone();
               }
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;
               Object responseValue = response.getResponseValue();
               if (responseValue == null) {
                  continue;
               }

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

Examples of org.infinispan.remoting.responses.SuccessfulResponse

                                               TxInvocationContext txInvocationContext, Object localResult) {
      if (txInvocationContext.isOriginLocal()) {
         final CacheTransaction cacheTransaction = txInvocationContext.getCacheTransaction();
         for (Response response : responseMap.values()) {
            if (response != null && response.isSuccessful()) {
               SuccessfulResponse sr = (SuccessfulResponse) response;
               EntryVersionsMap uv = (EntryVersionsMap) sr.getResponseValue();
               if (uv != null) {
                  cacheTransaction.setUpdatedEntryVersions(uv.merge(cacheTransaction.getUpdatedEntryVersions()));
               }
            }
         }
         return localResult;
      } else {
         EntryVersionsMap mergeResult = localResult instanceof EntryVersionsMap ? (EntryVersionsMap) localResult :
               new EntryVersionsMap();
         for (Response response : responseMap.values()) {
            if (response != null && response.isSuccessful()) {
               SuccessfulResponse sr = (SuccessfulResponse) response;
               EntryVersionsMap uv = (EntryVersionsMap) sr.getResponseValue();
               if (uv != null) {
                  mergeResult = mergeResult.merge(uv);
               }
            }
         }
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.