Search in sources :

Example 1 with ExecutionHandler

use of org.freeswitch.esl.client.internal.debug.ExecutionHandler in project bigbluebutton by bigbluebutton.

the class InboundPipelineFactory method getPipeline.

public ChannelPipeline getPipeline() throws Exception {
    ChannelPipeline pipeline = Channels.pipeline();
    pipeline.addLast("encoder", new StringEncoder());
    pipeline.addLast("decoder", new EslFrameDecoder(8192));
    // Add an executor to ensure separate thread for each upstream message from here
    pipeline.addLast("executor", new ExecutionHandler(new OrderedMemoryAwareThreadPoolExecutor(16, 1048576, 1048576)));
    // now the inbound client logic
    pipeline.addLast("clientHandler", handler);
    return pipeline;
}
Also used : StringEncoder(org.jboss.netty.handler.codec.string.StringEncoder) EslFrameDecoder(org.freeswitch.esl.client.transport.message.EslFrameDecoder) ExecutionHandler(org.freeswitch.esl.client.internal.debug.ExecutionHandler) OrderedMemoryAwareThreadPoolExecutor(org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline)

Example 2 with ExecutionHandler

use of org.freeswitch.esl.client.internal.debug.ExecutionHandler in project bigbluebutton by bigbluebutton.

the class AbstractOutboundPipelineFactory method getPipeline.

public ChannelPipeline getPipeline() throws Exception {
    ChannelPipeline pipeline = Channels.pipeline();
    // Add the text line codec combination first
    pipeline.addLast("encoder", new StringEncoder());
    // Note that outbound mode requires the decoder to treat many 'headers' as body lines
    pipeline.addLast("decoder", new EslFrameDecoder(8092, true));
    // Add an executor to ensure separate thread for each upstream message from here
    pipeline.addLast("executor", new ExecutionHandler(new OrderedMemoryAwareThreadPoolExecutor(16, 1048576, 1048576)));
    // now the outbound client logic
    pipeline.addLast("clientHandler", makeHandler());
    return pipeline;
}
Also used : StringEncoder(org.jboss.netty.handler.codec.string.StringEncoder) EslFrameDecoder(org.freeswitch.esl.client.transport.message.EslFrameDecoder) ExecutionHandler(org.freeswitch.esl.client.internal.debug.ExecutionHandler) OrderedMemoryAwareThreadPoolExecutor(org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline)

Aggregations

ExecutionHandler (org.freeswitch.esl.client.internal.debug.ExecutionHandler)2 EslFrameDecoder (org.freeswitch.esl.client.transport.message.EslFrameDecoder)2 ChannelPipeline (org.jboss.netty.channel.ChannelPipeline)2 StringEncoder (org.jboss.netty.handler.codec.string.StringEncoder)2 OrderedMemoryAwareThreadPoolExecutor (org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor)2