Examples of RspList


Examples of org.jgroups.util.RspList

        Vector subset=Util.pickSubset(members, 0.2);
        System.out.println("subset: " + subset);

        Util.sleep(1000);

        RspList rsps=disp.callRemoteMethods(subset, "foo", null, (Class[])null, GroupRequest.GET_ALL, 0, false);
        System.out.println("rsps (no anycast): " + rsps);

        rsps=disp.callRemoteMethods(subset, "foo", null, (Class[])null, GroupRequest.GET_ALL, 0, true);
        System.out.println("rsps (with anycast): " + rsps);
    }
View Full Code Here

Examples of org.jgroups.util.RspList

         boolean rc=req.execute();
         System.out.println("group request is " + req);
         assertTrue(rc);
         assertEquals(0, req.getSuspects().size());
         assertTrue(req.isDone());
         RspList results=req.getResults();
         assertEquals(2, results.size());
     }
View Full Code Here

Examples of org.jgroups.util.RspList

         boolean rc=req.execute();
         System.out.println("group request is " + req);
         assertTrue(rc);
         assertEquals(1, req.getSuspects().size());
         assertTrue(req.isDone());
         RspList results=req.getResults();
         assertEquals(2, results.size());
     }
View Full Code Here

Examples of org.jgroups.util.RspList

        boolean rc=req.execute();
        System.out.println("group request is " + req);
        assertTrue(rc);
        assertEquals(0, req.getSuspects().size());
        assertTrue(req.isDone());
        RspList results=req.getResults();
        assertEquals(2, results.size());
    }
View Full Code Here

Examples of org.jgroups.util.RspList

        boolean rc=req.execute();
        System.out.println("group request is " + req);
        assertTrue(rc);
        assertEquals(1, req.getSuspects().size());
        assertTrue(req.isDone());
        RspList results=req.getResults();
        assertEquals(2, results.size());
    }
View Full Code Here

Examples of org.jgroups.util.RspList

   {
       // we need to copy the vector, otherwise the modification below will throw an exception because the underlying
       // vector is unmodifiable
      Vector v = new Vector(c.getView().getMembers());
      if (excludeSelf) v.remove(c.getLocalAddress());
      RspList rsps=d.callRemoteMethods(v, "doSomething", new Object[]{}, new Class[]{}, GroupRequest.GET_ALL, 10000, useAnycast);
      Map.Entry entry;
       for(Iterator it=rsps.entrySet().iterator(); it.hasNext();) {
           entry=(Map.Entry)it.next();
           Address member=(Address)entry.getKey();
           Rsp rsp=(Rsp)entry.getValue();
           if(!rsp.wasReceived())
               throw new RuntimeException("response from " + member + " was not received, rsp=" + rsp);
View Full Code Here

Examples of org.jgroups.util.RspList

    }


    public void start() throws Exception {
        int     c;
        RspList rsps;

        channel=new JChannel(); // default props
  disp=new RpcDispatcher(channel, null, this, this);
  channel.connect("rpc-test");
       
View Full Code Here

Examples of org.jgroups.util.RspList

    {
        try
        {
            Object retval = null;

            RspList rsp = disp.callRemoteMethods(null, "_add", new Object[]{value}, add_signature, GroupRequest.GET_ALL, 0);
            Vector results = rsp.getResults();

            if (results.size() > 0)
            {
                retval = results.elementAt(0);
View Full Code Here

Examples of org.jgroups.util.RspList

     * @return the first object in the queue or null if none were found.
     */
    public Object remove()
    {
        Object retval = null;
        RspList rsp = disp.callRemoteMethods(null, "_remove", null, remove_signature, GroupRequest.GET_ALL, internal_timeout);
        Vector results = rsp.getResults();

        if (results.size() > 0)
        {
            retval = results.elementAt(0);

View Full Code Here

Examples of org.jgroups.util.RspList

        if (timeout <= 0)
        {
            while (!stopped && (retval == null))
            {
                RspList rsp = disp.callRemoteMethods(null, "_remove", null, remove_signature, GroupRequest.GET_ALL, internal_timeout);
                Vector results = rsp.getResults();

                if (results.size() > 0)
                {
                    retval = results.elementAt(0);

                    if (logger.isDebugEnabled())
                    {
                        checkResult(rsp, retval);
                    }
                }

                if (retval == null)
                {
                    try
                    {
                        synchronized (mutex)
                        {
                            mutex.wait();
                        }
                    }
                     catch (InterruptedException e)
                    {
                    }
                }
            }
        }
        else
        {
            while (((System.currentTimeMillis() - start) < timeout) && !stopped && (retval == null))
            {
                RspList rsp = disp.callRemoteMethods(null, "_remove", null, remove_signature, GroupRequest.GET_ALL, internal_timeout);
                Vector results = rsp.getResults();

                if (results.size() > 0)
                {
                    retval = results.elementAt(0);
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.