Life cycle of ChannelsBlaze Channels are in one of five states: Constructed - the Channel isn't initialized or has been shutDowninitialized -you can explicitly initialize a Channel by invoking its init() method. At this point its Configuration is set BlazeChannelFactory factory = new BlazeChannelFactory(); BlazeChannel channel = factory.createChannel(); channel.init(); started -this will implicitly initialize the channel and start the Channel's underlying communication with its peers: BlazeChannelFactory factory = new BlazeChannelFactory(); BlazeChannel channel = factory.createChannel(); channel.start(); stopped -this will stop communication - however you are able to re-start the channel at a latter point BlazeChannelFactory factory = new BlazeChannelFactory(); BlazeChannel channel = factory.createChannel(); channel.stop(); // do something else ... //re-start channel.start(); shut down
BlazeChannelFactory factory = new BlazeChannelFactory(); BlazeChannel channel = factory.createChannel(); channel.shutDown(); // change the congiguration channel.getConfiguration().setBroadcastURI("tcp://localhost:60661"); //re-start channel.start(); |