Package org.infinispan.remoting.responses

Examples of org.infinispan.remoting.responses.Response


   }

   public Object createExternal(Class<?> subjectType, ObjectInput input, Creator defaultCreator)
         throws IOException, ClassNotFoundException {
      boolean replayIgnoredRequests = input.readBoolean();
      Response response = (Response) input.readObject();
      return new ExtendedResponse(response, replayIgnoredRequests);
   }
View Full Code Here


      // If this thread blocked during a NBST flush, then inform the sender
      // it needs to replay ignored messages
      boolean replayIgnored = sr == DistributedSync.SyncResponse.STATE_ACHIEVED;

      Response resp = handleInternal(cmd);

      // A null response is valid and OK ...
      if (resp == null || resp.isValid()) {
         if (replayIgnored) resp = new ExtendedResponse(resp, true);
      } else {
         // invalid response
         if (trace) log.trace("Unable to execute command, got invalid response");
      }
View Full Code Here

            if (!usedResponseFilter) throw new TimeoutException("Replication timeout for " + sender);
         }
      } else {
         invalidResponse = false;
         if (responseObject instanceof Response) {
            Response response = (Response) responseObject;
            if (response instanceof ExceptionResponse) {
               Exception e = ((ExceptionResponse) response).getException();
               if (!(e instanceof RpcException)) {
                  // if we have any application-level exceptions make sure we throw them!!
                  if (shouldThrowException(e)) {
View Full Code Here

      if (lr.size() != 1) {
         log.warn("Expected just one response; got %s", lr);
         return RemoteTransactionLogDetails.DEFAULT;
      }

      Response r = lr.get(targetNode);
      if (r != null && r.isSuccessful() && r.isValid()) {
         return (RemoteTransactionLogDetails) ((SuccessfulResponse) r).getResponseValue();
      } else {
         throw new RpcException("Invalid response " + r);
      }
   }
View Full Code Here

         if (!unknownAddresses.isEmpty()) {
            Collection<NodeTopologyInfo> moreTopologies = null;
            for (Address topologyProvider : unknownAddresses) {
               Map<Address, Response> r = rpcManager.invokeRemotely(Collections.singleton(topologyProvider), cf.buildRehashControlCommand(RehashControlCommand.Type.FETCH_TOPOLOGY_INFO, self), true, true);
               Response resp = r.get(topologyProvider);
               if (resp.isSuccessful() && resp.isValid()) {
                  // we have the response we need!
                  moreTopologies = (Collection<NodeTopologyInfo>) ((SuccessfulResponse) resp).getResponseValue();
                  break;
               }
            }
View Full Code Here

         // If this thread blocked during a NBST flush, then inform the sender
         // it needs to replay ignored messages
         boolean replayIgnored = sr == DistributedSync.SyncResponse.STATE_ACHIEVED;
         if (trace) log.trace("Enough waiting; replayIgnored = {0}, sr {1}", replayIgnored, sr);

         Response resp = inboundInvocationHandler.handle(cmd);

         // A null response is valid and OK ...
         if (resp == null || resp.isValid()) {
            if (replayIgnored) resp = new ExtendedResponse(resp, true);
         } else {
            // invalid response
            newCacheStarting.set(true);
            if (trace) log.trace("Unable to execute command, got invalid response");
View Full Code Here

               }
            } else {
               noValidResponses = false;
               Object value = rsp.getValue();
               if (value instanceof Response) {
                  Response response = (Response) value;
                  if (response instanceof ExceptionResponse) {
                     Exception e = ((ExceptionResponse) value).getException();
                     if (!(e instanceof ReplicationException)) {
                        // if we have any application-level exceptions make sure we throw them!!
                        if (trace) log.trace("Received exception from " + rsp.getSender(), e);
View Full Code Here

      List<org.jgroups.Address> jgAddressList = toJGroupsAddressListExcludingSelf(recipients);
      int membersSize = members.size();
      boolean broadcast = jgAddressList == null || recipients.size() == membersSize;
      if (membersSize < 3 || (jgAddressList != null && jgAddressList.size() < 2)) broadcast = false;
      RspList<Object> rsps = null;
      Response singleResponse = null;
      org.jgroups.Address singleJGAddress = null;

      if (broadcast) {
         rsps = dispatcher.broadcastRemoteCommands(rpcCommand, toJGroupsMode(mode), timeout, recipients != null,
                                                   usePriorityQueue, toJGroupsFilter(responseFilter),
View Full Code Here

                                        req_marshaller, CommandAwareRpcDispatcher.this, oob, transport);
            }
         });
         return null; // don't wait for a response!
      } else {
         Response response;
         try {
            response = processSingleCall(command, timeout, recipient, mode,
                                         req_marshaller, this, oob, transport);
         } catch (InterruptedException e) {
            throw e;
View Full Code Here

      // Replay capability requires responses from all members!
      /// HACK ALERT!  Used for ISPN-1789.  Enable RSVP if the command is a state transfer control command or cache view control command.
      boolean rsvp = command instanceof StateTransferControlCommand || command instanceof CacheViewControlCommand;

      Response retval;
      Buffer buf;
      buf = marshallCall(marshaller, command);
      retval = card.sendMessage(constructMessage(buf, destination, oob, mode, rsvp),
                                new RequestOptions(mode, timeout));
View Full Code Here

TOP

Related Classes of org.infinispan.remoting.responses.Response

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.