Search in sources :

Example 6 with OrderedMemoryAwareThreadPoolExecutor

use of org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor in project bagheera by mozilla-metrics.

the class AccessFilterTest method setup.

@Before
public void setup() throws IOException {
    String[] namespaces = new String[] { "foo_*", "bar" };
    WildcardProperties props = new WildcardProperties();
    String propsFileStr = "foo_*.allow.delete.access=false\n" + "foo_*.id.validation=true\n" + "bar.allow.delete.access=true\n" + "bar.id.validation=false";
    InputStream is = new ByteArrayInputStream(propsFileStr.getBytes("UTF-8"));
    props.load(is);
    filter = new AccessFilter(new Validator(namespaces), props);
    remoteAddr = InetSocketAddress.createUnresolved("192.168.1.1", 51723);
    Channel channel = createMock(Channel.class);
    expect(channel.getCloseFuture()).andReturn(new DefaultChannelFuture(channel, false));
    expect(channel.getRemoteAddress()).andReturn(remoteAddr);
    OrderedMemoryAwareThreadPoolExecutor executor = new OrderedMemoryAwareThreadPoolExecutor(10, 0L, 0L);
    final ExecutionHandler handler = new ExecutionHandler(executor, true, true);
    ctx = new FakeChannelHandlerContext(channel, handler);
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) DefaultChannelFuture(org.jboss.netty.channel.DefaultChannelFuture) WildcardProperties(com.mozilla.bagheera.util.WildcardProperties) Channel(org.jboss.netty.channel.Channel) ExecutionHandler(org.jboss.netty.handler.execution.ExecutionHandler) OrderedMemoryAwareThreadPoolExecutor(org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor) Validator(com.mozilla.bagheera.validation.Validator) FakeChannelHandlerContext(org.jboss.netty.channel.FakeChannelHandlerContext) Before(org.junit.Before)

Example 7 with OrderedMemoryAwareThreadPoolExecutor

use of org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor in project bagheera by mozilla-metrics.

the class ContentLengthFilterTest method setup.

@Before
public void setup() {
    Channel channel = createMock(Channel.class);
    expect(channel.getCloseFuture()).andReturn(new DefaultChannelFuture(channel, false));
    expect(channel.getRemoteAddress()).andReturn(InetSocketAddress.createUnresolved("192.168.1.1", 51723));
    OrderedMemoryAwareThreadPoolExecutor executor = new OrderedMemoryAwareThreadPoolExecutor(10, 0L, 0L);
    final ExecutionHandler handler = new ExecutionHandler(executor, true, true);
    ctx = new FakeChannelHandlerContext(channel, handler);
}
Also used : DefaultChannelFuture(org.jboss.netty.channel.DefaultChannelFuture) Channel(org.jboss.netty.channel.Channel) ExecutionHandler(org.jboss.netty.handler.execution.ExecutionHandler) OrderedMemoryAwareThreadPoolExecutor(org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor) FakeChannelHandlerContext(org.jboss.netty.channel.FakeChannelHandlerContext) Before(org.junit.Before)

Aggregations

OrderedMemoryAwareThreadPoolExecutor (org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor)7 ExecutionHandler (org.freeswitch.esl.client.internal.debug.ExecutionHandler)2 EslFrameDecoder (org.freeswitch.esl.client.transport.message.EslFrameDecoder)2 Channel (org.jboss.netty.channel.Channel)2 ChannelPipeline (org.jboss.netty.channel.ChannelPipeline)2 DefaultChannelFuture (org.jboss.netty.channel.DefaultChannelFuture)2 FakeChannelHandlerContext (org.jboss.netty.channel.FakeChannelHandlerContext)2 StringEncoder (org.jboss.netty.handler.codec.string.StringEncoder)2 ExecutionHandler (org.jboss.netty.handler.execution.ExecutionHandler)2 Before (org.junit.Before)2 ServerPipelineFactory (com.jcumulus.server.rtmfp.ServerPipelineFactory)1 Sessions (com.jcumulus.server.rtmfp.Sessions)1 ConnectionStateFactory (com.linkedin.databus.client.ConnectionStateFactory)1 DatabusBootstrapConnectionFactory (com.linkedin.databus.client.DatabusBootstrapConnectionFactory)1 DatabusRelayConnectionFactory (com.linkedin.databus.client.DatabusRelayConnectionFactory)1 DatabusSourcesConnection (com.linkedin.databus.client.DatabusSourcesConnection)1 DatabusV2ConsumerRegistration (com.linkedin.databus.client.consumer.DatabusV2ConsumerRegistration)1 NettyHttpConnectionFactory (com.linkedin.databus.client.netty.NettyHttpConnectionFactory)1 ServerInfo (com.linkedin.databus.client.pub.ServerInfo)1 ConsumerCallbackStats (com.linkedin.databus.client.pub.mbean.ConsumerCallbackStats)1