Package org.jgroups

Examples of org.jgroups.JChannel.connect()


  public static final short ID = 1900;

  public static void main(String[] args) throws Exception {

    JChannel ch = new JChannel();
    ch.connect("demo");
    ch.setReceiver(new ReceiverAdapter() {
      public void receive(Message msg) {
        MyHeader hdr = (MyHeader) msg.getHeader(ID);
        System.out.println("-- received " + msg + ", header is " + hdr);
      }
View Full Code Here


   
    if(name != null) {
      channel.setName(name);
    }
   
    channel.connect("LargeStateChannel");
   
    while(true){
     
      Msg msg = new Msg(10000);
      channel.send(null, msg);
View Full Code Here

  }

  private void viewchecker(int time) throws Exception {

    JChannel channel = new JChannel();
    channel.connect("TestCluster");
    View view = channel.getView();
    logger.info("View ID: " + view.getViewId());
    logger.info("View creater: " + view.getCreator());
    logger.info("View coordinator: " + view.getMembers().get(0));
   
View Full Code Here

      public void viewAccepted(View view) {
        System.out.println("view: " + view);
      }});
   
    channel.connect("ChatCluster");
   
    for (;;) {
      String line = Util.readStringFromStdin(": ");
      channel.send(null, line);
    }
View Full Code Here

      public void viewAccepted(View view) {
        System.out.println("view: " + view);
      }});
   
    channel.connect("TPTest");
   
    TP transport = channel.getProtocolStack().getTransport();
   
    System.out.println("-------------- JGroups Protocol Stack Transport ----------------------");
    System.out.println("transport.getInfo(): " + transport.getInfo());
View Full Code Here

    JChannel channel = null;
   
    logger.info("Logical Name test without set logical name");
    channel = new JChannel();
    channel.connect("ChatCluster");
    channel.close();
   
    logger.info("Logical Name test while set logical name");
    channel = new JChannel();
    channel.setName(UUID.randomUUID().toString());
View Full Code Here

    channel.close();
   
    logger.info("Logical Name test while set logical name");
    channel = new JChannel();
    channel.setName(UUID.randomUUID().toString());
    channel.connect("ChatCluster");
    channel.close();
  }

  private void protocolStackTest() throws Exception {
View Full Code Here

  public void test() throws Exception {

    logger.info("JChannel getAddress(), getClusterName(), getView() Test");
   
    JChannel channel = new JChannel();
    channel.connect("ChatCluster");
   
    logger.info("** getAddress(): " + channel.getAddress());
    logger.info("** getClusterName(): " + channel.getClusterName());
   
    logger.info("** getView(): " + channel.getView());
View Full Code Here

                    int index=tmp.indexOf(':');
                    props=LOOPBACK + tmp.substring(index);
                }
                channel=new JChannel(props);
                // System.out.println("props:\n" + channel.getProperties());
                channel.connect(group_name);
                if(debug) {
                    debugger=new Debugger(channel, cummulative);
                    debugger.start();
                }
            }
View Full Code Here

    public void testOneChannel() throws Exception {
        JChannel channel = new JChannel();
        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");
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.