Package org.jgroups

Examples of org.jgroups.JChannel.connect()


      Properties p = newGC.getTransportProperties();
      String jgroupsCfg = p.getProperty(JGroupsTransport.CONFIGURATION_STRING);
      try {
         JChannel channel = new JChannel(jgroupsCfg);
         channel.setName(newGC.getTransportNodeName());
         channel.connect(newGC.getClusterName());
         return channel;
      } catch (Exception e) {
         throw new CacheException(e);
      }
   }
View Full Code Here


  }

  protected JChannel createChannel() throws Exception {
    JChannel channel = new JChannel( ConfigurationParseHelper.locateConfig( JGroupsCommonTest.TESTING_JGROUPS_CONFIGURATION_FILE ) );
    channel.setUpHandler( new MuxUpHandler() );
    channel.connect( "JGroupsCommonTest" + JGroupsCommonTest.CHANNEL_NAME );
    return channel;
  }

  protected abstract String getMasterBackend();
View Full Code Here

    cfg.getProperties().put( DispatchMessageSender.CHANNEL_INJECT, slaveChannel );
  }

  private static JChannel createChannel() throws Exception {
    JChannel channel = new JChannel( ConfigurationParseHelper.locateConfig( JGroupsCommonTest.TESTING_JGROUPS_CONFIGURATION_FILE ) );
    channel.connect( "JGroupsCommonTest" + JGroupsCommonTest.CHANNEL_NAME );
    return channel;
  }

}
View Full Code Here

    Assert.notNull(protocolStackConfigurator, "JGroups protocol stack configurator is null");
    Assert.hasText(clusterName, "JGroups cluster name is null or empty");

    JChannel channel = new JChannel(protocolStackConfigurator);
    channel.connect(clusterName);

    return channel;

  }
View Full Code Here

      Properties p = gc.transport().properties();
      String jgroupsCfg = p.getProperty(JGroupsTransport.CONFIGURATION_STRING);
      try {
         JChannel channel = new JChannel(jgroupsCfg);
         channel.setName(gc.transport().nodeName());
         channel.connect(gc.transport().clusterName());
         return channel;
      } catch (Exception e) {
         throw new CacheException(e);
      }
   }
View Full Code Here

            }
        };

        ReplicatedTree tree = new ReplicatedTree(control, conflictResolver, 5000);

        jchannel.connect("test_tree_cluster", null, 10000);
        final Address myAddress = jchannel.getAddress();


        DistributedTreeTKB tkb = new DistributedTreeTKB(new DistributedTreeAdapter(tree), myAddress.toString());
        tkb.run();
View Full Code Here

                log.info("CONTROL: setState()");
            }
        });

        log.info("connecting...");
        jchannel.connect("test_cluster");
        log.info("connecetd");

        synchronized (lock) {
            while (!clustered)
                lock.wait();
View Full Code Here

            }
        };

        ReplicatedTree tree = new ReplicatedTree(control, conflictResolver, 5000);

        jchannel.connect("test_tree_cluster", null, 10000);
        final Address myAddress = jchannel.getAddress();


        put(tree, "/a/b/c", false, "kjkhkjh");
        put(tree, "/a/b/c1", false, null);
View Full Code Here

      Properties p = gc.transport().properties();
      String jgroupsCfg = p.getProperty(JGroupsTransport.CONFIGURATION_STRING);
      try {
         JChannel channel = new JChannel(jgroupsCfg);
         channel.setName(gc.transport().nodeName());
         channel.connect(gc.transport().clusterName());
         return channel;
      } catch (Exception e) {
         throw new CacheException(e);
      }
   }
View Full Code Here

     * Channel is set to not receive own messages.
     */
    protected JGroupsRemoteConnection createConnection(boolean isLocalConnectionBeingCreated) throws RemoteCommandManagerException {
        try {
            JChannel channel = new JChannel();
            channel.connect(this.rcm.getChannel());
            channel.setDiscardOwnMessages(true);
            return new JGroupsRemoteConnection(this.rcm, channel, isLocalConnectionBeingCreated);
        } catch (Exception ex) {
            throw RemoteCommandManagerException.errorCreatingJGroupsConnection(this.configFile, ex);
        }
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.