public Draw(Channel channel) throws Exception { this.channel=channel; channel.setOpt(Channel.AUTO_RECONNECT, Boolean.TRUE); channel.setReceiver(this); channel.addChannelListener(this); }
public Draw(Channel channel, boolean use_state, long state_timeout) throws Exception { this.channel=channel; channel.setOpt(Channel.AUTO_RECONNECT, Boolean.TRUE); channel.setReceiver(this); channel.addChannelListener(this); this.use_state=use_state; this.state_timeout=state_timeout; }
public void start(final long timeout) throws Exception { if(channel != null) { return; } channel = new JChannel(channel_properties); // Set the auto-reconnect option for enabling a node to leave and re-join the cluster channel.setOpt(Channel.AUTO_RECONNECT, true); disp = new RpcDispatcher(channel, this, this, this); channel.connect(groupname); rc = channel.getState(null, timeout); if(rc) { if(log.isInfoEnabled()) { log.info("state was retrieved successfully"); } } else if(log.isInfoEnabled()) { log.info("state could not be retrieved (must be first member in group)"); } }
public Draw(String props, boolean no_channel, boolean jmx, boolean use_state, long state_timeout) throws Exception { this.no_channel=no_channel; this.jmx=jmx; this.use_state=use_state; this.state_timeout=state_timeout; if(no_channel) return; channel=new JChannel(props); // channel.setOpt(Channel.BLOCK, Boolean.TRUE); channel.setOpt(Channel.AUTO_RECONNECT, Boolean.TRUE); channel.setReceiver(this); channel.addChannelListener(this); }
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); } addWindowListener(this); }
public void start(String props, boolean use_additional_data) throws Exception { channel=new JChannel(props); channel.setOpt(Channel.AUTO_RECONNECT, Boolean.TRUE); if(use_additional_data) { HashMap m=new HashMap(); m.put("additional_data", "bela".getBytes()); channel.down(new Event(Event.CONFIG, m)); } channel.connect("ViewDemo"); new PullPushAdapter(channel, this); while(true) { Util.sleep(10000); } }
public Gossip(String props, long traffic) throws Exception { channel=new JChannel(props); channel.addChannelListener(this); channel.setOpt(Channel.AUTO_RECONNECT, Boolean.TRUE); traffic_interval=traffic; if(traffic_interval > 0) { gen=new TrafficGenerator(); gen.start(); } }
bus = new NotificationBus(BUS_NAME, properties); bus.start(); bus.getChannel().setOpt(Channel.LOCAL, new Boolean(false)); bus.setConsumer(this); log.info("JavaGroups clustering support started successfully");
protected void startupExternal() throws Exception { // TODO: need to do more research to figure out the best default transport // settings // to avoid fragmentation, etc. // if config file is set, use it, otherwise use a default // set of properties, trying to configure multicast address and port if (configURL != null) { channel = new JChannel(configURL); } else { String configString = buildConfigString(); channel = new JChannel(configString); } // Important - discard messages from self channel.setOpt(Channel.LOCAL, Boolean.FALSE); channel.connect(externalSubject); if (receivesExternalEvents()) { adapter = new PullPushAdapter(channel, this); } }
protected void startupExternal() throws Exception { // TODO: need to do more research to figure out the best default transport // settings // to avoid fragmentation, etc. // if config file is set, use it, otherwise use a default // set of properties, trying to configure multicast address and port if (configURL != null) { channel = new JChannel(configURL); } else { String configString = buildConfigString(); channel = new JChannel(configString); } // Important - discard messages from self channel.setOpt(Channel.LOCAL, Boolean.FALSE); channel.connect(externalSubject); if (receivesExternalEvents()) { adapter = new PullPushAdapter(channel, this); } }