Package org.jgroups.blocks

Examples of org.jgroups.blocks.RpcDispatcher


      log.warn("Starting cache");
      cache.start();
      // now remove the existing RpcDispatcher and replace with one that is a noop.
      ComponentRegistry cr = TestingUtil.extractComponentRegistry(cache);
      RPCManager rpcManager = cr.getComponent(RPCManager.class);
      RpcDispatcher d = (RpcDispatcher) TestingUtil.extractField(rpcManager, "rpcDispatcher");
      d.stop();
      RpcDispatcher replacement = new NoopDispatcher();
      replacement.setRequestMarshaller(d.getRequestMarshaller());
      replacement.setResponseMarshaller(d.getResponseMarshaller());
      ReflectionUtil.setValue(rpcManager, "rpcDispatcher", replacement);

      long duration = System.currentTimeMillis() - startTime;
      log.warn("Started cache.  " + printDuration(duration));
   }
View Full Code Here


    public void start(String props, String name) throws Exception {
        ch=new JChannel(props);
        if(name != null)
            ch.setName(name);
        disp=new RpcDispatcher(ch, null, this, this);
        ch.connect("RelayDemo");
        local_addr=ch.getAddress().toString();

        MethodCall call=new MethodCall(getClass().getMethod("handleMessage", String.class, String.class));
        for(;;) {
View Full Code Here

    public QuoteClient() {
        super();
        try {
            channel=new JChannel(props);
            channel.setDiscardOwnMessages(true);
            disp=new RpcDispatcher(channel, null, this, this);
            channel.connect(channel_name);
        }
        catch(Exception e) {
            System.err.println("QuoteClient(): " + e);
        }
View Full Code Here


    public void start() {
        try {
            channel=new JChannel(props);
            disp=new RpcDispatcher(channel, this, this, this);
            channel.connect(channel_name);
            System.out.println("\nQuote Server started at " + new Date());
            System.out.println("Joined channel '" + channel_name + "' (" + channel.getView().size() + " members)");
            channel.getState(null, 0);
            System.out.println("Ready to serve requests");
View Full Code Here

  colors.put(new Integer(7),  Color.cyan);
  colors.put(new Integer(8),  Color.blue);
  mythread=new Thread(this);
  try {
      channel=new JChannel();
      dispatcher=new RpcDispatcher(channel, null, null, this);
      channel.connect(groupname);
  }
  catch(Exception e) {
      System.err.println(e);
      System.exit(0);
View Full Code Here

    public QuoteClient() {
        super();
        try {
            channel=new JChannel(props);
            channel.setOpt(Channel.LOCAL, Boolean.FALSE);
            disp=new RpcDispatcher(channel, null, this, this);
            channel.connect(channel_name);
        }
        catch(Exception e) {
            System.err.println("QuoteClient(): " + e);
        }
View Full Code Here

    }

    public void start() {
        try {
            channel=new JChannel(props);
            disp=new RpcDispatcher(channel, this, this, this);
            channel.connect(channel_name);
            System.out.println("\nQuote Server started at " + new Date());
            System.out.println("Joined channel '" + channel_name + "' (" + channel.getView().size() + " members)");
            channel.getState(null, 0);
            System.out.println("Ready to serve requests");
View Full Code Here

        public PushChannelApplication(String name,ChannelTestFactory factory,boolean useDispatcher) throws Exception{
            super(name, factory);
            events = Collections.synchronizedList(new LinkedList<Object>());
            if(useDispatcher){
                dispatcher = new RpcDispatcher(channel, this, this, this);
            }else{
                channel.setReceiver(this);
            }
        }
View Full Code Here

    void start(String props, boolean use_rpc) throws Exception {
        long i=0;
        Message msg;
        ch=new JChannel(props);
        if(use_rpc)
           disp=new RpcDispatcher(ch, null, null, this);
        ch.connect("NAKACKTest");
        local_addr=ch.getLocalAddress();
        if(use_rpc == false) {
            receiver=new Receiver();
            receiver.start();
View Full Code Here

     * @throws Exception
     */
    public void testOneChannel() throws Exception {
        Channel channel = createChannel();
        ServerObject serverObject = new ServerObject("obj1");
        RpcDispatcher disp=new RpcDispatcher(channel, null, null, serverObject, DEADLOCK_DETECTION);
        serverObject.setRpcDispatcher(disp);
        channel.connect(name);
        Address localAddress = channel.getLocalAddress();

        // 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, GroupRequest.GET_ALL, 0);
        log("results of outerMethod(): " + rspList);

        assertEquals(1, rspList.size());
        assertEquals("outerMethod[innerMethod]", rspList.getValue(localAddress));
        assertTrue(rspList.isReceived(localAddress));
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.