@SuppressWarnings("resource") public ChannelCommandDispatcherFactory(ChannelCommandDispatcherFactoryConfiguration config) { this.marshallingContext = config.getMarshallingContext(); this.timeout = config.getTimeout(); JChannel channel = config.getChannel(); RequestCorrelator correlator = new RequestCorrelator(channel.getProtocolStack(), this, channel.getAddress()).setMarshaller(new CommandResponseMarshaller(config)); this.dispatcher = new MessageDispatcher() .setChannel(channel) .setRequestHandler(this) .setMembershipListener(this) .asyncDispatching(true) // Setting the request correlator starts the dispatcher .correlator(correlator) ; this.view.compareAndSet(null, channel.getView()); }
@SuppressWarnings("resource") public ChannelCommandDispatcherFactory(ChannelCommandDispatcherFactoryConfiguration config) { this.marshallingContext = config.getMarshallingContext(); this.timeout = config.getTimeout(); JChannel channel = config.getChannel(); RequestCorrelator correlator = new RequestCorrelator(channel.getProtocolStack(), this, channel.getAddress()).setMarshaller(new CommandResponseMarshaller(config)); this.dispatcher = new MessageDispatcher() .setChannel(channel) .setRequestHandler(this) .setMembershipListener(this) .asyncDispatching(true) // Setting the request correlator starts the dispatcher .correlator(correlator) ; this.view.compareAndSet(null, channel.getView()); }