Examples of ExecutionHandler


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

    // logging handler
    pipeline.addFirst("logger", new LoggingHandler());
    // responsible for reading until SCMP frame is complete
    pipeline.addLast("framer", new NettySCMPFrameDecoder());
    // executer to run NettyTcpResponderRequestHandler in own thread
    pipeline.addLast("executor", new ExecutionHandler(AppContext.getSCWorkerThreadPool()));
    // responsible for handling request
    pipeline.addLast("handler", new NettyTcpResponderRequestHandler());
    return pipeline;
  }
View Full Code Here

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

  public ChannelPipeline getPipeline() throws Exception {
    ChannelPipeline pipeline = Channels.pipeline();
    // logging handler
    pipeline.addLast("logger", new LoggingHandler());
    // executer to run NettyTcpProxyResponderRequestHandler in own thread
    pipeline.addLast("executor", new ExecutionHandler(AppContext.getOrderedSCWorkerThreadPool()));
    // responsible for handle requests - Stabilit
    pipeline.addLast("handler", new NettyTcpProxyResponderRequestHandler(cf, remoteHost, remotePort));
    return pipeline;
  }
View Full Code Here

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

    // responsible for encoding requests - Netty
    pipeline.addLast("encoder", new HttpRequestEncoder());
    // responsible for aggregate chunks - Netty
    pipeline.addLast("aggregator", new HttpChunkAggregator(Constants.MAX_HTTP_CONTENT_LENGTH));
    // executer to run NettyHttpRequesterResponseHandler in own thread
    pipeline.addLast("executor", new ExecutionHandler(AppContext.getSCWorkerThreadPool()));
    // responsible for handle responses - Stabilit
    pipeline.addLast("requesterResponseHandler", new NettyHttpRequesterResponseHandler());
    return pipeline;
  }
View Full Code Here

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

    // responsible for encoding responses - Netty
    pipeline.addLast("encoder", new HttpResponseEncoder());
    // responsible for aggregate chunks - Netty
    pipeline.addLast("aggregator", new HttpChunkAggregator(Constants.MAX_HTTP_CONTENT_LENGTH));
    // executer to run NettyHttpResponderRequestHandler in own thread
    pipeline.addLast("executor", new ExecutionHandler(AppContext.getSCWorkerThreadPool()));
    // responsible for handle requests - Stabilit
    pipeline.addLast("handler", new NettyHttpResponderRequestHandler());
    return pipeline;
  }
View Full Code Here

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

    // responsible for observing idle timeout - Netty
    pipeline.addLast("idleTimeout", new NettyIdleHandler(this.context, this.timer, 0, 0, this.context.getIdleTimeoutSeconds()));
    // responsible for reading until SCMP frame is complete
    pipeline.addLast("framer", new NettySCMPFrameDecoder());
    // executer to run NettyTcpRequesterResponseHandler in own thread
    pipeline.addLast("executor", new ExecutionHandler(AppContext.getSCWorkerThreadPool()));
    // responsible for handle response - Stabilit
    pipeline.addLast("requesterResponseHandler", new NettyTcpRequesterResponseHandler());
    return pipeline;
  }
View Full Code Here

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

    }

    public void run()
    {
        // Configure the server.
        executionHandler = new ExecutionHandler(new RequestThreadPoolExecutor());
        factory = new NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool());
        ServerBootstrap bootstrap = new ServerBootstrap(factory);

        // Set up the event pipeline factory.
        bootstrap.setPipelineFactory(new PipelineFactory(this));
View Full Code Here

Examples of util.io.ExecutionHandler

    return true;
  }

  public void sendToKNotify(final String titleFormat, final String descriptionFormat, final Program program) {
    try {
      final ExecutionHandler executionHandler = new ExecutionHandler("dcop",
          "which");
      executionHandler.execute(true);

      String dcopLocation = executionHandler.getOutput();

      if (dcopLocation != null) {
        dcopLocation = dcopLocation.trim();
        if (dcopLocation.length() > 0) {
          // create the notification message
          if (mParser == null) {
            mParser = new ParamParser();
          }
          final String title = mParser.analyse(titleFormat,program);
          final String message = mParser.analyse(descriptionFormat, program);

          // run the notification command
          final String[] command = { dcopLocation, "knotify", "Notify",
              "notify", "event", title, message, "", "", "16", "0" };
          new ExecutionHandler(command).execute();
        }
      }
      else {
        mLog.warning("'dcop' command not found");
      }
View Full Code Here

Examples of util.io.ExecutionHandler

      file.deleteOnExit();
     
      ICalFile ical = new ICalFile();
      ical.export(file, programs, settings, formating);
     
      new ExecutionHandler("--merge " + file.getAbsolutePath(), "korganizer").execute();
      return true;
    } catch (IOException e) {
      ErrorHandler.handle("Could not export to KOrganizer.", e);
      e.printStackTrace();
    }
View Full Code Here

Examples of util.io.ExecutionHandler

          ParamParser parser = new ParamParser();
          String fParam = parser.analyse(
              mSettings.getProperty("execparam", ""), reminder.getProgram());

          try {
            ExecutionHandler executionHandler = new ExecutionHandler(fParam,
                fName);
            executionHandler.execute();
          } catch (Exception exc) {
            String msg = mLocalizer.msg("error.2",
                "Error executing reminder program!\n({0})", fName, exc);
            ErrorHandler.handle(msg, exc);
          }
View Full Code Here

Examples of util.io.ExecutionHandler

    OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(scriptFile), "UTF-8");
    writer.write(script);
    writer.close();

    ExecutionHandler executionHandler = new ExecutionHandler(scriptFile.getAbsolutePath(), "osascript");
    executionHandler.execute(true, "UTF-8");

    int time = 0;

    // wait until the process has exited, max MaxTimouts

    if (mTimeOut > 0) {
      while (time < mTimeOut * 1000) {
        try {
          Thread.sleep(100);
        } catch (InterruptedException e1) {
        }
        time += 100;
        try {
          executionHandler.exitValue();
          break;
        } catch (IllegalThreadStateException e) {
        }
      }
    } else {
      while (true) {
        try {
          Thread.sleep(100);
        } catch (InterruptedException e1) {
        }
        try {
          executionHandler.exitValue();
          break;
        } catch (IllegalThreadStateException e) {
        }
      }
    }

    while (time < mTimeOut * 1000) {
      try {
        Thread.sleep(100);
      } catch (InterruptedException e1) {
      }
      time += 100;
      try {
        executionHandler.exitValue();
        break;
      } catch (IllegalThreadStateException e) {
      }
    }

    // get the process output
    String output = "";

    if (!executionHandler.getInputStreamReaderThread().isAlive()) {
      output = executionHandler.getOutput();
    }

    mLog.info("AppleScript Output:");
    mLog.info(output);

    if (executionHandler.exitValue() >= 0) {
      return output;
    }

    try {
      scriptFile.delete();
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.