Package org.jgroups.util

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


                                                new Class[]{String.class},
                                                GroupRequest.GET_ALL, 10000);

                Float val=null;
                for(int i=0; i < rsp_list.size(); i++) {
                    Rsp rsp=(Rsp)rsp_list.elementAt(i);
                    Object obj=rsp.getValue();
                    if(obj == null || obj instanceof Throwable)
                        continue;
                    val=(Float)obj;
                    break;
View Full Code Here


                        System.out.println("rsp_list is " + rsp_list);

                        Hashtable all_stocks=null;
                        for(int i=0; i < rsp_list.size(); i++) {
                            Rsp rsp=(Rsp)rsp_list.elementAt(i);
                            Object obj=rsp.getValue();
                            if(obj == null || obj instanceof Throwable)
                                continue;
                            all_stocks=(Hashtable)obj;
                            break;
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

            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

        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(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

                                                new String[]{String.class.getName()},
                                                GroupRequest.GET_ALL, 10000);

                Float val=null;
                for(int i=0; i < rsp_list.size(); i++) {
                    Rsp rsp=(Rsp)rsp_list.elementAt(i);
                    Object obj=rsp.getValue();
                    if(obj == null || obj instanceof Throwable)
                        continue;
                    val=(Float)obj;
                    break;
View Full Code Here

                        System.out.println("rsp_list is " + rsp_list);

                        Hashtable all_stocks=null;
                        for(int i=0; i < rsp_list.size(); i++) {
                            Rsp rsp=(Rsp)rsp_list.elementAt(i);
                            Object obj=rsp.getValue();
                            if(obj == null || obj instanceof Throwable)
                                continue;
                            all_stocks=(Hashtable)obj;
                            break;
View Full Code Here

      org.jgroups.Message jmessage = new org.jgroups.Message(null, null, pingMesg);
      RspList res = mdispatcher_.castMessage(null, jmessage, GroupRequest.GET_ALL, 0);
      List results = new ArrayList();
      for (int i = 0; i < res.size(); i++)
      {
         Rsp rsp = (Rsp)res.elementAt(i);
         PingResult result = new PingResult(Util.createMemberInfo(rsp.getSender()), (String)rsp.getValue());
         results.add(result);
      }
      return results;
   }
View Full Code Here

        group_req.execute();
        lst=group_req.getResults();
        System.out.println("-- received " + lst.size() + " results:");
        for(int i=0; i < lst.size(); i++) {
            System.out.println(lst.elementAt(i));
        }
        System.out.println();
    }
   
    /* --------------------------- Interface MessageListener -------------------------- */
 
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.