Package org.jgroups.util

Examples of org.jgroups.util.RspList.elementAt()


        }
        if(rsp_list.size() > 1) {
            if(log.isWarnEnabled())
                log.warn("response list contains more that 1 response; returning first response !");
        }
        rsp=(Rsp)rsp_list.elementAt(0);
        if(rsp.wasSuspected()) {
            throw new SuspectedException(dest);
        }
        if(!rsp.wasReceived()) {
            throw new TimeoutException("timeout sending message to " + dest);
View Full Code Here


        RspList rsps=disp.callRemoteMethods(members, "foo", null, new Class[]{String.class, String.class},
                                            GroupRequest.GET_ALL, 8000);
        System.out.println("responses:\n" + rsps + ", channel.view: " + channel.getView() + ", channel2.view: " + channel2.getView());
        assertEquals(members.size(), rsps.size());
        for(int i=0; i < rsps.size(); i++) {
            Rsp rsp=(Rsp)rsps.elementAt(i);
            assertTrue("response value is " + rsp.getValue(), rsp.getValue() instanceof NoSuchMethodException);
        }
    }

View Full Code Here

        }
        if(rsp_list.size() > 1) {
            if(log.isWarnEnabled())
                log.warn("response list contains more that 1 response; returning first response !");
        }
        rsp=(Rsp)rsp_list.elementAt(0);
        if(rsp.wasSuspected()) {
            throw new SuspectedException(dest);
        }
        if(!rsp.wasReceived()) {
            throw new TimeoutException("timeout sending message to " + dest);
View Full Code Here

         log.trace("(" + getLocalAddress() + "): responses for method " + method_call.getName() + ":\n" + rsps);

      retval = new ArrayList(rsps.size());
      for (int i = 0; i < rsps.size(); i++)
      {
         rsp = (Rsp) rsps.elementAt(i);
         if (rsp.wasSuspected() || !rsp.wasReceived())
         {
            CacheException ex;
            if (rsp.wasSuspected())
            {
View Full Code Here

        }
        if(rsp_list.size() > 1) {
            if(log.isWarnEnabled())
                log.warn("response list contains more that 1 response; returning first response !");
        }
        rsp=(Rsp)rsp_list.elementAt(0);
        if(rsp.wasSuspected()) {
            throw new SuspectedException(dest);
        }
        if(!rsp.wasReceived()) {
            throw new TimeoutException("timeout sending message to " + dest);
View Full Code Here

            return null;
        }
        if(rsp_list.size() > 1)
            if(log.isErrorEnabled()) log.error("response list contains " +
                                                         "more that 1 response; returning first response");
        rsp=(Rsp)rsp_list.elementAt(0);
        if(rsp.wasSuspected())
            throw new SuspectedException(dest);
        if(!rsp.wasReceived())
            throw new TimeoutException();
        return rsp.getValue();
View Full Code Here

            dests.addElement(dest);
            req=new GroupRequest(msg, corr, dests, GroupRequest.GET_FIRST, timeout_return_state, 0);
            req.execute();
            rsp_list=req.getResults();
            for(int i=0; i < rsp_list.size(); i++) {  // get the first non-suspected result
                rsp=(Rsp)rsp_list.elementAt(i);
                if(rsp.wasReceived())
                    return (byte[])rsp.getValue();
            }
            Util.sleep(1000);
        }
View Full Code Here

  /* Process all the responses (Digest): compute a range of messages (min and max seqno) for each
     member that has to be re-broadcast; FlushRsp contains those messages. They will be re-braodcast
     by the cordinator (in the GMS protocol). */
  for(int i=0; i < rsp_list.size(); i++) {
      Rsp rsp=(Rsp)rsp_list.elementAt(i);
      if(rsp.wasReceived()) {
    digest=(Digest)rsp.getValue();
    if(digest != null) {
        for(int j=0; j < digest.highest_seqnos.length && j < min.length; j++) {
      min[j]=Math.min(min[j], digest.highest_seqnos[j]);
View Full Code Here

         log.trace("(" + getLocalAddress() + "): responses for method " + method_call.getName() + ":\n" + rsps);

      retval = new ArrayList(rsps.size());
      for (int i = 0; i < rsps.size(); i++)
      {
         rsp = (Rsp) rsps.elementAt(i);
         if (rsp.wasSuspected() || !rsp.wasReceived())
         {
            CacheException ex;
            if (rsp.wasSuspected())
            {
View Full Code Here

         log.trace("(" + getLocalAddress() + "): responses for method " + method_call.getName() + ":\n" + rsps);

      retval = new ArrayList(rsps.size());
      for (int i = 0; i < rsps.size(); i++)
      {
         rsp = (Rsp) rsps.elementAt(i);
         if (rsp.wasSuspected() || !rsp.wasReceived())
         {
            CacheException ex;
            if (rsp.wasSuspected())
            {
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.