Examples of executor()


Examples of io.netty.channel.ChannelHandlerContext.executor()

    /**
     * See {@link #close()}
     */
    public ChannelFuture close(final ChannelPromise future) {
        final ChannelHandlerContext ctx = this.ctx;
        ctx.executor().execute(new Runnable() {
            @Override
            public void run() {
                engine.closeOutbound();
                try {
                    write(ctx, Unpooled.EMPTY_BUFFER, future);
View Full Code Here

Examples of io.netty.channel.ChannelHandlerContext.executor()

    private ChannelHandlerContext channelHandlerContext() {
        final ChannelHandlerContext ctx = mock(ChannelHandlerContext.class);
        final EventExecutor eventExecutor = mock(EventExecutor.class);
        final ScheduledFuture future = mock(ScheduledFuture.class);
        when(eventExecutor.scheduleAtFixedRate(any(Runnable.class), anyLong(), anyLong(), any(TimeUnit.class))).thenReturn(future);
        when(ctx.executor()).thenReturn(eventExecutor);
        when(ctx.pipeline()).thenReturn(mock(ChannelPipeline.class));
        return ctx;
    }

}
View Full Code Here

Examples of io.netty.channel.ChannelHandlerContext.executor()

    /**
     * See {@link #close()}
     */
    public ChannelFuture close(final ChannelPromise future) {
        final ChannelHandlerContext ctx = this.ctx;
        ctx.executor().execute(new Runnable() {
            @Override
            public void run() {
                engine.closeOutbound();
                try {
                    write(ctx, Unpooled.EMPTY_BUFFER, future);
View Full Code Here

Examples of net.jcores.jre.CommonCore.executor()

            }
        };

        // Execute all our runnables.
        for(int i=0; i<NUM_THREADS; i++) {
            cc.executor().getExecutor().execute(runner);
        }

        // Wait for all threads to finish ...
        try {
            barrier.await();
View Full Code Here

Examples of org.elasticsearch.transport.TransportRequestHandler.executor()

            if (handler == null) {
                throw new ActionNotFoundTransportException(action);
            }
            final Streamable streamable = handler.newInstance();
            streamable.readFrom(buffer);
            if (handler.executor() == ThreadPool.Names.SAME) {
                //noinspection unchecked
                handler.messageReceived(streamable, transportChannel);
            } else {
                threadPool.executor(handler.executor()).execute(new RequestHandler(handler, streamable, transportChannel, action));
            }
View Full Code Here

Examples of org.elasticsearch.transport.TransportRequestHandler.executor()

            streamable.readFrom(buffer);
            if (handler.executor() == ThreadPool.Names.SAME) {
                //noinspection unchecked
                handler.messageReceived(streamable, transportChannel);
            } else {
                threadPool.executor(handler.executor()).execute(new RequestHandler(handler, streamable, transportChannel, action));
            }
        } catch (Exception e) {
            try {
                transportChannel.sendResponse(e);
            } catch (IOException e1) {
View Full Code Here

Examples of org.elasticsearch.transport.TransportRequestHandler.executor()

            if (handler == null) {
                throw new ActionNotFoundTransportException(action);
            }
            final TransportRequest request = handler.newInstance();
            request.readFrom(buffer);
            if (handler.executor().equals(ThreadPool.Names.SAME)) {
                //noinspection unchecked
                handler.messageReceived(request, transportChannel);
            } else {
                threadPool.executor(handler.executor()).execute(new RequestHandler(handler, request, transportChannel, action));
            }
View Full Code Here

Examples of org.elasticsearch.transport.TransportRequestHandler.executor()

            request.readFrom(buffer);
            if (handler.executor().equals(ThreadPool.Names.SAME)) {
                //noinspection unchecked
                handler.messageReceived(request, transportChannel);
            } else {
                threadPool.executor(handler.executor()).execute(new RequestHandler(handler, request, transportChannel, action));
            }
        } catch (Throwable e) {
            try {
                transportChannel.sendResponse(e);
            } catch (IOException e1) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.