use of org.jboss.netty.channel.local.DefaultLocalServerChannelFactory in project databus by linkedin.
the class TestRelayCommandsLocal method setUp.
@BeforeMethod
public void setUp() throws Exception {
// creates an event factory for us
_relay = new HttpRelay(_staticConfig, null);
_eventBuffer = _relay.getEventBuffer();
DatabusEventProducer randomEventProducer = new DatabusEventRandomProducer(_eventBuffer, 10, 1, 10, _staticConfig.getSourceIds(), null, null);
RequestProcessorRegistry processorRegistry = _relay.getProcessorRegistry();
processorRegistry.register(EchoRequestProcessor.COMMAND_NAME, new EchoRequestProcessor(null));
processorRegistry.register(GenerateDataEventsRequestProcessor.COMMAND_NAME, new GenerateDataEventsRequestProcessor(null, _relay, randomEventProducer));
// Configure the server.
_bootstrap = new ServerBootstrap(new DefaultLocalServerChannelFactory());
// Set up the event pipeline factory.
_bootstrap.setPipelineFactory(new HttpServerPipelineFactory(_relay));
_serverAddress = new LocalAddress(10);
_serverChannel = _bootstrap.bind(_serverAddress);
}
use of org.jboss.netty.channel.local.DefaultLocalServerChannelFactory in project databus by linkedin.
the class DummyHttpRequestHandler method setupServer.
private void setupServer(DummyHttpRequestHandler requestHandler) {
_serverBootstrap = new ServerBootstrap(new DefaultLocalServerChannelFactory());
ChannelPipeline serverPipeline = pipeline();
serverPipeline.addLast("server logger 1", new LoggingHandler("server logger 1", InternalLogLevel.DEBUG, true));
serverPipeline.addLast("decoder", new HttpRequestDecoder());
serverPipeline.addLast("encoder", new HttpResponseEncoder());
serverPipeline.addLast("server loggger 5", new LoggingHandler("server logger 5", InternalLogLevel.DEBUG, true));
serverPipeline.addLast("handler", requestHandler);
_serverBootstrap.setPipeline(serverPipeline);
_serverAddress = new LocalAddress(1);
_serverChannel = _serverBootstrap.bind(_serverAddress);
}
Aggregations