public void start(JChannel channel) throws Exception { map=new ReplicatedHashMap<>(channel); map.addNotifier(this); map.start(10000);
/** * Initialize the JGROUPS channel and connect them to the group. * * @throws Exception */ private void startChannels() throws Exception { this.log.start(); // start the discovery HashMap and wait the synchronization of its data this.discoveryHashMapChannel.connect(this.domainConfiguration .getDomain()); this.containerAddressesHashMap.start(LATENTY_MAX_TIME); this.discoveryCoordinationChannel.connect(this.domainConfiguration .getDomain()); if (this.jndiHashMapChannel != null) { // start the JNDI HashMap and wait the synchronization of its data this.jndiHashMapChannel.connect(this.domainConfiguration .getDomain()); this.jndiHashMap.start(LATENTY_MAX_TIME); } this.log.end(); }
public void start(JChannel channel) throws Exception { map=new ReplicatedHashMap<>(channel); map.addNotifier(this); map.start(10000);
/** * Creates a ReplicatedHashMap * @param clustername The name of the group to join * @param factory The ChannelFactory which will be used to create a channel * @param properties The property string to be used to define the channel. This will override the properties of * the factory. If null, then the factory properties will be used * @param state_timeout The time to wait until state is retrieved in milliseconds. A value of 0 means wait forever. */ public ReplicatedHashMap(String clustername, ChannelFactory factory, String properties, long state_timeout) throws ChannelException { this.cluster_name=clustername; if(factory != null) { channel=properties != null? factory.createChannel(properties) : factory.createChannel(); } else { channel=new JChannel(properties); } disp=new RpcDispatcher(channel, this, this, this); disp.setMethodLookup(new MethodLookup() { public Method findMethod(short id) { return methods.get(id); } }); channel.connect(clustername); start(state_timeout); }
start(state_timeout);