Package io.netty.util.concurrent

Examples of io.netty.util.concurrent.DefaultExecutorServiceFactory


        this.myAddress = myAddress;
        this.peerAddress = peerAddress;
    }

    public void run() throws Exception {
        final ExecutorServiceFactory connectFactory = new DefaultExecutorServiceFactory("rendezvous");
        final NioEventLoopGroup connectGroup =
                new NioEventLoopGroup(1, connectFactory, NioUdtProvider.BYTE_PROVIDER);

        try {
            final Bootstrap bootstrap = new Bootstrap();
View Full Code Here


        this.peer = peer;
    }

    public void run() throws Exception {
        // Configure the peer.
        final ExecutorServiceFactory connectFactory = new DefaultExecutorServiceFactory("rendezvous");
        final NioEventLoopGroup connectGroup =
                new NioEventLoopGroup(1, connectFactory, NioUdtProvider.MESSAGE_PROVIDER);

        try {
            final Bootstrap boot = new Bootstrap();
View Full Code Here

public final class MsgEchoServer {

    static final int PORT = Integer.parseInt(System.getProperty("port", "8007"));

    public static void main(String[] args) throws Exception {
        final ExecutorServiceFactory acceptFactory = new DefaultExecutorServiceFactory("accept");
        final ExecutorServiceFactory connectFactory = new DefaultExecutorServiceFactory("connect");
        final NioEventLoopGroup acceptGroup =
                new NioEventLoopGroup(1, acceptFactory, NioUdtProvider.MESSAGE_PROVIDER);
        final NioEventLoopGroup connectGroup =
                new NioEventLoopGroup(1, connectFactory, NioUdtProvider.MESSAGE_PROVIDER);
View Full Code Here

    static final int PORT = Integer.parseInt(System.getProperty("port", "8007"));
    static final int SIZE = Integer.parseInt(System.getProperty("size", "256"));

    public static void main(String[] args) throws Exception {
        // Configure the client.
        final ExecutorServiceFactory connectFactory = new DefaultExecutorServiceFactory("connect");
        final NioEventLoopGroup connectGroup =
                new NioEventLoopGroup(1, connectFactory, NioUdtProvider.MESSAGE_PROVIDER);

        try {
            final Bootstrap boot = new Bootstrap();
View Full Code Here

        final ChannelHandler handler1 = new EchoMessageHandler(rate, size);
        final ChannelHandler handler2 = new EchoMessageHandler(null, size);

        final NioEventLoopGroup group1 =
                new NioEventLoopGroup(1, new DefaultExecutorServiceFactory("group1"), NioUdtProvider.MESSAGE_PROVIDER);
        final NioEventLoopGroup group2 =
                new NioEventLoopGroup(1, new DefaultExecutorServiceFactory("group2"), NioUdtProvider.MESSAGE_PROVIDER);

        final Bootstrap peerBoot1 = new Bootstrap();
        peerBoot1.group(group1)
                 .channelFactory(NioUdtProvider.MESSAGE_RENDEZVOUS)
                 .localAddress(addr1).remoteAddress(addr2).handler(handler1);
View Full Code Here

    public void testConcurrentAddRemoveOutboundEvents() throws Throwable {
        testConcurrentAddRemove(false);
    }

    private static void testConcurrentAddRemove(boolean inbound) throws Exception {
        EventLoopGroup l = new DefaultEventLoopGroup(4, new DefaultExecutorServiceFactory("l"));
        EventExecutorGroup e1 = new DefaultEventExecutorGroup(4, new DefaultExecutorServiceFactory("e1"));
        EventExecutorGroup e2 = new DefaultEventExecutorGroup(4, new DefaultExecutorServiceFactory("e2"));
        EventExecutorGroup e3 = new DefaultEventExecutorGroup(4, new DefaultExecutorServiceFactory("e3"));
        EventExecutorGroup e4 = new DefaultEventExecutorGroup(4, new DefaultExecutorServiceFactory("e4"));
        EventExecutorGroup e5 = new DefaultEventExecutorGroup(4, new DefaultExecutorServiceFactory("e5"));

        final EventExecutorGroup[] groups = { e1, e2, e3, e4, e5 };
        try {
            Deque<EventType> events = new ConcurrentLinkedDeque<EventType>();
            final EventForwarder h1 = new EventForwarder();
View Full Code Here

        assertTrue(loopGroup.isTerminated());
    }

    private static final class TestEventExecutor extends SingleThreadEventExecutor {
        TestEventExecutor() {
            super(null, new DefaultExecutorServiceFactory(TestEventExecutor.class).newExecutorService(1), false);
        }
View Full Code Here

    private SingleThreadEventLoopA loopA;
    private SingleThreadEventLoopB loopB;

    @BeforeClass
    public static void newExecutor() {
        executor = new DefaultExecutorServiceFactory("SingleThreadEventLoopTest").newExecutorService(2);
    }
View Full Code Here

        final EchoByteHandler handler1 = new EchoByteHandler(rate1, messageSize);
        final EchoByteHandler handler2 = new EchoByteHandler(rate2, messageSize);

        final NioEventLoopGroup group1 =
                new NioEventLoopGroup(1, new DefaultExecutorServiceFactory("group1"), NioUdtProvider.BYTE_PROVIDER);
        final NioEventLoopGroup group2 =
                new NioEventLoopGroup(1, new DefaultExecutorServiceFactory("group2"), NioUdtProvider.BYTE_PROVIDER);

        final Bootstrap boot1 = new Bootstrap();
        boot1.group(group1)
             .channelFactory(NioUdtProvider.BYTE_RENDEZVOUS)
             .localAddress(addr1)
View Full Code Here

        }

        @Override
        public void run() {
            final ServerBootstrap boot = new ServerBootstrap();
            final ExecutorServiceFactory acceptFactory = new DefaultExecutorServiceFactory("accept");
            final ExecutorServiceFactory serverFactory = new DefaultExecutorServiceFactory("server");
            final NioEventLoopGroup acceptGroup =
                    new NioEventLoopGroup(1, acceptFactory, NioUdtProvider.BYTE_PROVIDER);
            final NioEventLoopGroup connectGroup =
                    new NioEventLoopGroup(1, serverFactory, NioUdtProvider.BYTE_PROVIDER);
View Full Code Here

TOP

Related Classes of io.netty.util.concurrent.DefaultExecutorServiceFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.