Examples of SuccessfulResponse


Examples of org.infinispan.remoting.responses.SuccessfulResponse

* @author Manik Surtani
* @since 4.0
*/
public class SuccessfulResponseExternalizer implements Externalizer {
   public void writeExternal(Object o, ObjectOutput objectOutput) throws IOException {
      SuccessfulResponse sr = (SuccessfulResponse) o;
      objectOutput.writeObject(sr.getResponseValue());
   }
View Full Code Here

Examples of org.infinispan.remoting.responses.SuccessfulResponse

      SuccessfulResponse sr = (SuccessfulResponse) o;
      objectOutput.writeObject(sr.getResponseValue());
   }

   public Object createExternal(Class<?> aClass, ObjectInput objectInput, Creator creator) throws IOException, ClassNotFoundException {
      return new SuccessfulResponse();
   }
View Full Code Here

Examples of org.infinispan.remoting.responses.SuccessfulResponse

   public Object createExternal(Class<?> aClass, ObjectInput objectInput, Creator creator) throws IOException, ClassNotFoundException {
      return new SuccessfulResponse();
   }

   public void readExternal(Object o, ObjectInput objectInput) throws IOException, ClassNotFoundException {
      SuccessfulResponse sr = (SuccessfulResponse) o;
      sr.setResponseValue(objectInput.readObject());
   }
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

      for (Map.Entry<Address, Response> e : responses.entrySet()) {
         if (!e.getValue().isSuccessful() || !e.getValue().isValid()) {
            failed.add(e.getKey());
            continue;
         }
         SuccessfulResponse response = (SuccessfulResponse) e.getValue();
         log.tracef("Got status %s from node %s", response.getResponseValue(), e.getKey());
         if (response.getResponseValue() == XSiteAdminCommand.Status.OFFLINE) {
            offline.add(e.getKey());
         } else if (response.getResponseValue() == XSiteAdminCommand.Status.ONLINE) {
            online.add(e.getKey());
         } else {
            throw new IllegalStateException("Unknown response: " + response.getResponseValue());
         }
      }
      if (!failed.isEmpty()) {
         return rpcError(failed, "Could not query nodes ");
      }
View Full Code Here

Examples of org.infinispan.remoting.responses.SuccessfulResponse

      for (Map.Entry<Address, Response> e : responses.entrySet()) {
         if (!e.getValue().isSuccessful() || !e.getValue().isValid()) {
            failed.add(e.getKey());
            continue;
         }
         SuccessfulResponse response = (SuccessfulResponse) e.getValue();
         log.tracef("Got status %s from node %s", response.getResponseValue(), e.getKey());
         if (response.getResponseValue() == XSiteAdminCommand.Status.OFFLINE) {
            offline.add(e.getKey());
         } else if (response.getResponseValue() == XSiteAdminCommand.Status.ONLINE) {
            online.add(e.getKey());
         } else {
            throw new IllegalStateException("Unknown response: " + response.getResponseValue());
         }
      }
      if (!failed.isEmpty()) {
         return rpcError(failed, "Could not query nodes ");
      }
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();
               InternalCacheEntry ice = cacheValue.toInternalCacheEntry(key);
               if (rvrl != null) {
                  rvrl.remoteValueFound(ice);
               }
               return ice;
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

Examples of org.infinispan.remoting.responses.SuccessfulResponse

*/
@Immutable
public class SuccessfulResponseExternalizer implements Externalizer {

   public void writeObject(Marshaller output, Object subject) throws IOException {
      SuccessfulResponse sr = (SuccessfulResponse) subject;
      output.writeObject(sr.getResponseValue());     
   }
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.