Examples of ExecutionHandler


Examples of com.dragome.commons.ExecutionHandler

public class RequestExecutorImpl implements RequestExecutor
{
  public String executeSynchronousRequest(String url, Map<String, String> parameters)
  {
    final ExecutionHandler executionHandler= ServiceLocator.getInstance().getConfigurator().getExecutionHandler();
    if (executionHandler.canSuspend())
    {
      final String[] resultArray= new String[] { "" };

      AsyncCallback<String> asyncCallbackToContinue= new AsyncCallback<String>()
      {
        public void onSuccess(String result)
        {
          resultArray[0]= result;
          executionHandler.continueExecution();
        }

        public void onError()
        {
          throw new RuntimeException("Error in async call");
        }
      };
      AsyncCallback<String> wrappedCallback= wrapCallback(Serializable.class, asyncCallbackToContinue);
      executeHttpRequest(true, url, parameters, wrappedCallback, false);

      executionHandler.suspendExecution();
      return resultArray[0];
    }
    else
      return executeHttpRequest(false, url, parameters, null, false);
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.netty.handler.execution.ExecutionHandler

        // gather all chunks into a single http message
        pipeline.addLast("aggregator", new HttpChunkAggregator(maxContentLength));

        // move response handler to user worker pool
        pipeline.addLast("pipelineExecutor", new ExecutionHandler(executor));

        // response handler
        pipeline.addLast("handler", new NettyHttpResponseChannelHandler(nettyConnectionPool));

        return pipeline;
View Full Code Here

Examples of io.netty.handler.execution.ExecutionHandler

        ServerBootstrap bootstrap = new ServerBootstrap(
                new SctpServerSocketChannelFactory(
                        Executors.newCachedThreadPool(),
                        Executors.newCachedThreadPool()));

        final ExecutionHandler executionHandler = new ExecutionHandler(
                new OrderedMemoryAwareThreadPoolExecutor(16, 1048576, 1048576));

        // Set up the pipeline factory.
        bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
            @Override
View Full Code Here

Examples of org.freeswitch.esl.client.internal.debug.ExecutionHandler

        // 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() );
       
View Full Code Here

Examples of org.jboss.netty.handler.execution.ExecutionHandler

    _defaultTrackingExecutorService =
      new TrackingExecutorService(_enabledTrackingExecutorServiceState,
                                  _disabledTrackingExecutorServiceState,
                                  runtimeConfig.getDefaultExecutor().isTrackerEnabled());*/
    _nettyExecHandler = new ExecutionHandler(_defaultExecutorService);

    _componentStatus = createComponentStatus();
    _componentAdmin = createComponentAdmin();
    _componentAdmin.registerAsMBean();

View Full Code Here

Examples of org.jboss.netty.handler.execution.ExecutionHandler

                }

                pipeline.addLast("decoder", new HttpRequestDecoder(maxInitialLineLength, maxHeaderSize, maxChunkSize));
                pipeline.addLast("encoder", new HttpResponseEncoder());
                pipeline.addLast("chunks", new ChunkedWriteHandler());
                pipeline.addLast("executor", new ExecutionHandler(executor));
                pipeline.addLast("jerseyHandler", jerseyHandler);

                return pipeline;
            }
View Full Code Here

Examples of org.jboss.netty.handler.execution.ExecutionHandler

        if (consumer.getConfiguration().isOrderedThreadPoolExecutor()) {
            // this must be added just before the ServerChannelHandler
            // use ordered thread pool, to ensure we process the events in order, and can send back
            // replies in the expected order. eg this is required by TCP.
            // and use a Camel thread factory so we have consistent thread namings
            ExecutionHandler executionHandler = new ExecutionHandler(consumer.getEndpoint().getComponent().getExecutorService());
            addToPipeline("executionHandler", channelPipeline, executionHandler);
            LOG.debug("Using OrderedMemoryAwareThreadPoolExecutor with core pool size: {}", consumer.getConfiguration().getMaximumPoolSize());
        }

        // our handler must be added last
View Full Code Here

Examples of org.jboss.netty.handler.execution.ExecutionHandler

        if (consumer.getConfiguration().isOrderedThreadPoolExecutor()) {
            // this must be added just before the HttpServerMultiplexChannelHandler
            // use ordered thread pool, to ensure we process the events in order, and can send back
            // replies in the expected order. eg this is required by TCP.
            // and use a Camel thread factory so we have consistent thread namings
            ExecutionHandler executionHandler = new ExecutionHandler(consumer.getEndpoint().getComponent().getExecutorService());
            pipeline.addLast("executionHandler", executionHandler);
            LOG.debug("Using OrderedMemoryAwareThreadPoolExecutor with core pool size: {}", consumer.getConfiguration().getMaximumPoolSize());
        }

        int port = consumer.getConfiguration().getPort();
View Full Code Here

Examples of org.jboss.netty.handler.execution.ExecutionHandler

      ChannelPipeline pipeline = Channels.pipeline();
      pipeline.addLast("decoder", new TSODecoder(null));
      pipeline.addLast("encoder", new TSOEncoder());
      synchronized (this) {
          if (x == null)
              x = new ExecutionHandler(pipelineExecutor);
          if (bwhandler == null)
              bwhandler = new BandwidthMeterHandler();
//          if (timer == null)
//             timer = new HashedWheelTimer();
      }
View Full Code Here

Examples of org.jboss.netty.handler.execution.ExecutionHandler

      // Create the bootstrap
      bootstrap = new ClientBootstrap(factory);
     
      int executorThreads = conf.getInt("tso.executor.threads", 3);

      bootstrap.getPipeline().addLast("executor", new ExecutionHandler(
            new OrderedMemoryAwareThreadPoolExecutor(executorThreads, 1024*1024, 4*1024*1024)));
      bootstrap.getPipeline().addLast("handler", this);
      bootstrap.setOption("tcpNoDelay", false);
      bootstrap.setOption("keepAlive", true);
      bootstrap.setOption("reuseAddress", true);
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.