Package org.jgroups.blocks

Examples of org.jgroups.blocks.RpcDispatcher


         log.info("JGroups version: " + org.jgroups.Version.printDescription());

         try {
            ch = new JChannel(configFile);

            disp = new RpcDispatcher(ch, null, this, this);
            disp.setMethodLookup(new MethodLookup() {
               public Method findMethod(short id) {
                  return METHODS[id];
               }
            });
View Full Code Here


                throw new Exception("No MBeanServers found;" +
                                    "\nJmxTest needs to be run with an MBeanServer present, or inside JDK 5"); }
            MBeanServer server=(MBeanServer)servers.get(0);
            JmxConfigurator.registerChannel(channel, server, "JGroups:channel=" + channel.getChannelName() , true);
*/
            disp = new RpcDispatcher(channel, ml, this, this);
            disp.setMarshaller(getMarshaller());
           
            // See if Anycast is supported
            try
            {
View Full Code Here

      {
         disp = new InactiveRegionAwareRpcDispatcher(channel, messageListener, new MembershipListenerAdaptor(), remoteDelegate);
      }
      else
      {
         disp = new RpcDispatcher(channel, messageListener, new MembershipListenerAdaptor(), remoteDelegate);
      }

      disp.setRequestMarshaller(marshaller);
      disp.setResponseMarshaller(marshaller);
   }
View Full Code Here

                throw new Exception("No MBeanServers found;" +
                                    "\nJmxTest needs to be run with an MBeanServer present, or inside JDK 5"); }
            MBeanServer server=(MBeanServer)servers.get(0);
            JmxConfigurator.registerChannel(channel, server, "JGroups:channel=" + channel.getChannelName() , true);
*/
            disp = new RpcDispatcher(channel, ml, this, this);
            disp.setMarshaller(getMarshaller());

            // See if Anycast is supported
            try
            {
View Full Code Here

                throw new Exception("No MBeanServers found;" +
                                    "\nJmxTest needs to be run with an MBeanServer present, or inside JDK 5"); }
            MBeanServer server=(MBeanServer)servers.get(0);
            JmxConfigurator.registerChannel(channel, server, "JGroups:channel=" + channel.getChannelName() , true);
*/
            disp = new RpcDispatcher(channel, ml, this, this);
            disp.setMarshaller(getMarshaller());
           
            // See if Anycast is supported
            try
            {
View Full Code Here

                throw new Exception("No MBeanServers found;" +
                                    "\nJmxTest needs to be run with an MBeanServer present, or inside JDK 5"); }
            MBeanServer server=(MBeanServer)servers.get(0);
            JmxConfigurator.registerChannel(channel, server, "JGroups:channel=" + channel.getChannelName() , true);
*/
            disp = new RpcDispatcher(channel, ml, this, this);
            disp.setMarshaller(getMarshaller());
           
            // See if Anycast is supported
            try
            {
View Full Code Here

     * @throws Exception
     */
    public void testOneChannel() throws Exception {
        c1 = createChannel(true);
        ServerObject serverObject = new ServerObject("obj1");
        RpcDispatcher disp=new RpcDispatcher(c1, serverObject);
        serverObject.setRpcDispatcher(disp);
        c1.connect(name);
        Address localAddress = c1.getAddress();

        // call the nested group method on itself
        MethodCall call = new MethodCall("outerMethod", new Object[0], new Class[0]);
        log("calling outerMethod() on all members");
        RspList rspList = disp.callRemoteMethods(null, call, new RequestOptions(ResponseMode.GET_ALL, 0));
        log("results of outerMethod(): " + rspList);

        Assert.assertEquals(1, rspList.size());
        assertEquals("outerMethod[innerMethod]", rspList.getValue(localAddress));
        assertTrue(rspList.isReceived(localAddress));
View Full Code Here

    public void testTwoChannels() throws Throwable {
        ServerObject obj1, obj2 = null;

        c1 = createChannel(true);
        obj1 = new ServerObject("obj1");
        RpcDispatcher disp1=new RpcDispatcher(c1, obj1);
        obj1.setRpcDispatcher(disp1);
        c1.connect(name);

        c2 = createChannel(c1);
        obj2 = new ServerObject("obj2");
        RpcDispatcher disp2=new RpcDispatcher(c2, obj2);
        obj2.setRpcDispatcher(disp2);
        c2.connect(name);
        Address localAddress2 = c2.getAddress();

        // call a point-to-point method on Member 2 that triggers a nested distributed RPC
View Full Code Here

    public void testTwoChannelsWithInitialMulticast() throws Exception {
        ServerObject obj1, obj2 = null;

        c1 = createChannel(true);
        obj1 = new ServerObject("obj1");
        RpcDispatcher disp1=new RpcDispatcher(c1, obj1);
        obj1.setRpcDispatcher(disp1);
        c1.connect(name);

        c2 = createChannel(c1);
        obj2 = new ServerObject("obj2");
        RpcDispatcher disp2=new RpcDispatcher(c2, obj2);
        obj2.setRpcDispatcher(disp2);
        c2.connect(name);

        Vector<Address> dests=new Vector<Address>();
        dests.add(c1.getAddress());
View Full Code Here

    protected void setUp() throws Exception {
      a = createNode(LON, "A");
      b = createNode(LON, "B");
      al=new MyReceiver("A");
      bl=new MyReceiver("B");
      rpca = new RpcDispatcher(a, al, al, new ServerObject(a, 1));
      rpcb = new RpcDispatcher(b, bl, bl, new ServerObject(b, 1));
     
      x = createNode(SFO, "X");
      y = createNode(SFO, "Y");
      xl=new MyReceiver("X");
      yl=new MyReceiver("Y");
      rpcx = new RpcDispatcher(x, xl, xl, new ServerObject(x, 1));
      rpcy = new RpcDispatcher(y, yl, yl, new ServerObject(y, 1));
    }
View Full Code Here

TOP

Related Classes of org.jgroups.blocks.RpcDispatcher

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.