Package org.jgroups

Examples of org.jgroups.JChannel$MyProbeHandler


   
    logger.info("JChannelStateTest start");

    validation(args);

    channel = new JChannel("udp.xml");
    channel.setName(name);
    channel.setReceiver(this);
    channel.setDiscardOwnMessages(true);
    channel.connect("JChannelGetStateTest");
    if(isGet) {
View Full Code Here


  public void test() throws Exception {
   
    logger.info("'org.jgroups.blocks.RpcDispatcher' test with future");
   
    channel = new JChannel();
    disp = new RpcDispatcher(channel, this);
    channel.connect("RpcDispatcherTestGroup");
   
    logger.info(" -> View Id: " + channel.getView().getViewId());
    logger.info(" -> View Creater: " + channel.getView().getCreator());
View Full Code Here

  }

  private void logicalNameTest() throws Exception {

    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());
    channel.connect("ChatCluster");
    channel.close();
  }
View Full Code Here

  private void protocolStackTest() throws Exception {

    logger.info("programmatically create a channel start");
   
    JChannel channel = new JChannel(false);
    ProtocolStack stack = new ProtocolStack();
    channel.setProtocolStack(stack);
   
    stack.addProtocols(new UDP().setValue("bind_addr", InetAddress.getByName("192.168.1.108")))
        .addProtocol(new PING())
        .addProtocol(new MERGE2())
        .addProtocol(new FD_SOCK())
View Full Code Here

  private void constructorTest() throws Exception {

    logger.info("construct JChannel with udp.xml");
   
    JChannel channel = new JChannel("udp.xml");
    channel.close();
  }
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());
    logger.info(" -> View Id: " + channel.getView().getViewId());
    logger.info(" -> View Creater: " + channel.getView().getCreator());
    logger.info(" -> View Coordinator: " + channel.getView().getMembers().get(0));
    logger.info(" -> View Memembers: " + channel.getView().getMembers());
//    for( Address addr : channel.getView().getMembers()) {
//      logger.info("    className: " + addr.getClass() + ", value: " + addr);
//    }
  }
View Full Code Here

    @Override
    public void incomingBroadcast() {
        try {
            logger.info("Starting Atmosphere JGroups Clustering support with group name {}", getID());

            jchannel = new JChannel();
            jchannel.setReceiver(new ReceiverAdapter() {
                /** {@inheritDoc} */
                @Override
                public void receive(final Message message) {
                    final Object msg = message.getObject();
View Full Code Here

        Future broadcastedMessage = mock(Future.class);
       
        when(broadcaster.getID()).thenReturn("/topic");
        when(broadcaster.broadcast("message")).thenReturn(broadcastedMessage);
       
        JChannel channel1 = new JChannel();
        JChannel channel2 = new JChannel();
       
        channel1.getProtocolStack().insertProtocolAtTop(new FLUSH());
        channel2.getProtocolStack().insertProtocolAtTop(new FLUSH());
       
        JGroupsChannel node1 = new JGroupsChannel(channel1, "cluster");
        JGroupsChannel node2 = new JGroupsChannel(channel2, "cluster");
       
        node1.addBroadcaster(broadcaster);
        node2.addBroadcaster(broadcaster);
       
        node1.init();
        node2.init();
       
        node2.send("/topic", "message");
       
        channel2.startFlush(false);
       
        assertEquals(channel1.getReceivedMessages(), 1);
        assertEquals(channel2.getReceivedMessages(), 1);
        verify(broadcaster, times(1)).broadcast("message");
    }
View Full Code Here

    }

    public static synchronized JGroupsChannel getDefaultJGroupsChannel(String jGroupsFilterLocation, String channelName) {
        if (jc == null) {
            try {
                JChannel channel = new JChannel(jGroupsFilterLocation);
                jc = new JGroupsChannel(channel, channelName);

                jc.init();
            } catch (Exception e) {
                throw new RuntimeException("Failed to create JGroupsChannel", e);
View Full Code Here

         {
            this.refCount = 1;
            this.channelName = channelName;
            if (t instanceof URL)
            {
               this.channel = new JChannel((URL) t);
            }
            else if (t instanceof JChannel)
            {
               this.channel = (JChannel) t;
            }
View Full Code Here

TOP

Related Classes of org.jgroups.JChannel$MyProbeHandler

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.