Examples of ProcessMonitor


Examples of com.adito.agent.client.util.ProcessMonitor

      // // Can we change the working directory of the process?
      try {
        Method m = Runtime.class.getMethod("exec", new Class[] { //$NON-NLS-1$
          String[].class, String[].class, File.class });
        Process prc = (Process) m.invoke(Runtime.getRuntime(), new Object[] { cmdargs, envp, workingDir });
        process = new ProcessMonitor(launcher.getName(), prc);
      } catch (Throwable t) {
        if (workingDir != null) {
          throw new IOException(Messages.getString("JavaApplicationType.failedToChangeWorkingDirectory") //$NON-NLS-1$
            + "changed, but this Java Virtual Machine does not support that."); //$NON-NLS-1$
        }
        process = new ProcessMonitor(launcher.getName(), Runtime.getRuntime().exec(cmdargs));
      }
    } catch (IOException ex) {
      if (events != null)
        events.debug(MessageFormat.format(Messages.getString("JavaApplicationType.processExecutionFailed"), new Object[] { ex.getMessage() })); //$NON-NLS-1$
    }
View Full Code Here

Examples of com.adito.agent.client.util.ProcessMonitor

                events.executingApplication(launcher.getName(), cmdline.trim());

            // Can we change the working directory of the process?
            try {
                Method m = Runtime.class.getMethod("exec", new Class[] { String[].class, String[].class, File.class }); //$NON-NLS-1$
                process = new ProcessMonitor(launcher.getName(), (Process) m.invoke(Runtime.getRuntime(), new Object[] { cmdargs,
                    null,
                    workingDir }));
            } catch (Throwable t) {
                if (workingDir != null) {
                    t.printStackTrace();

                    // Try cmd.exe on windows

                    throw new IOException(Messages.getString("ExecutableApplicationType.applicationRequestsThatTheWorkingDirectoryIsChange") + ""); //$NON-NLS-1$ //$NON-NLS-2$
                }
                process = new ProcessMonitor(launcher.getName(), Runtime.getRuntime().exec(cmdargs));
            }
        } catch (IOException ex) {
            if (events != null)
                events.debug(MessageFormat.format(Messages.getString("ExecutableApplicationType.processExecutionFailed"), new Object[] { ex.getMessage() } ) ); //$NON-NLS-1$
        }
View Full Code Here

Examples of com.adito.agent.client.util.ProcessMonitor

          events.finishedLaunch();
         
          if(!hasErrored) {
              try {
          out = new FileOutputStream(FileCleaner.deleteOnExit(new File(launcher.getInstallDir(), launcher.getName() + ".out"))); //$NON-NLS-1$
          ProcessMonitor monitor = launcher.getApplicationType().getProcessMonitor();
          if (monitor != null) {
              monitor.watch(out, out);
          }
        } catch (Throwable e) {
        } finally {
                if (out != null) {
                    try {
View Full Code Here

Examples of com.adito.agent.client.util.ProcessMonitor

                } else {
                    // Show an error message and kill the process
                    System.out.println(Messages.getString("VPNLauncher.sysout.failedSync")); //$NON-NLS-1$
                    System.out.println(result.getContent());
                    ProcessMonitor monitor = launcher.getApplicationType().getProcessMonitor();
                    if (monitor != null) {
                        // We cant kill the process as there may be error
                        // dialogs
                        // monitor.kill();
                        setMessage(Messages.getString("VPNLauncher.failedSync")); //$NON-NLS-1$
View Full Code Here

Examples of com.adito.applications.server.ProcessMonitor

    if (log.isDebugEnabled())
      log.debug("Executing command: " + cmdline);

    try {
      Process prc = Runtime.getRuntime().exec(args, null, workingDir);
      process = new ProcessMonitor(launcher.getName(), prc);
    } catch (IOException ex) {
      log.error("Failed to launch server command", ex);
    }

  }
View Full Code Here

Examples of com.adito.applications.server.ProcessMonitor

      if (events != null)
        events.executingApplication(launcher.getName(), cmdline.trim());

      // Can we change the working directory of the process?
      Process prc = Runtime.getRuntime().exec(cmdargs, null, workingDir);
      process = new ProcessMonitor(launcher.getName(), prc);
    } catch (IOException ex) {
      if (events != null)
        events.debug("Process execution failed: " + ex.getMessage());
    }
View Full Code Here

Examples of com.alibaba.otter.shared.arbitrate.impl.setl.rpc.monitor.ProcessMonitor

    /**
     * 获取最小一个符合条件的processId,排除loadedProcessId
     */
    private Long getMinTransformedProcessId(Long loadedProcessId) {
        ProcessMonitor processMonitor = ArbitrateFactory.getInstance(getPipelineId(), ProcessMonitor.class);
        List<Long> processIds = processMonitor.getCurrentProcessIds();
        // 如果需要当前node处理当前process的load时,rpc请求一定会将对应的stage状态发到这机器上,并保存到progress中
        if (!CollectionUtils.isEmpty(processIds) && !CollectionUtils.isEmpty(progress)) {
            // 上一次load成功的在当前的processId中不存在,可能有两种情况:
            // 1. zk还未将数据通知过来,当前current processIds还是为老版本的值
            // 2. processId已经被删除,比如好久没有数据同步了,定时触发时发觉列表一直为空
View Full Code Here

Examples of com.netflix.exhibitor.core.processes.ProcessMonitor

        this.additionalUITabs = (additionalUITabs != null) ? ImmutableList.copyOf(additionalUITabs) : ImmutableList.<UITab>of();
        this.processOperations = new StandardProcessOperations(this);
        monitorRunningInstance = new MonitorRunningInstance(this);
        cleanupManager = new CleanupManager(this);
        indexCache = new IndexCache(log);
        processMonitor = new ProcessMonitor(this);
        autoInstanceManagement = new RepeatingActivityImpl(log, activityQueue, QueueGroups.MAIN, new AutomaticInstanceManagement(this), getAutoInstanceManagementPeriod());

        remoteInstanceRequestClient = new RemoteInstanceRequestClientImpl(arguments.remoteConnectionConfiguration);

        AtomicReference<CompositeMonitor<?>>    theMonitor = new AtomicReference<CompositeMonitor<?>>();
View Full Code Here

Examples of org.exist.storage.ProcessMonitor

            final CompiledXQuery compiled = xquery.compile(context, source);

//            Sequence result = xquery.execute(compiled, subject.getName());

        final ProcessMonitor pm = db.getProcessMonitor();

            //execute the XQuery
            try {
            final UserDefinedFunction function = context.resolveFunction(functionName, 0);
            if (function != null) {
                  context.getProfiler().traceQueryStart();
                  pm.queryStarted(context.getWatchDog());
                 
                  final FunctionCall call = new FunctionCall(context, function);
                  if (args != null)
                    {call.setArguments(args);}
                  call.analyze(new AnalyzeContextInfo());
              call.eval(NodeSet.EMPTY_SET);
            }
            } catch(final XPathException e) {
              //XXX: log
              e.printStackTrace();
            } finally {
              if (pm != null) {
                context.getProfiler().traceQueryEnd(context);
                pm.queryCompleted(context.getWatchDog());
              }
              compiled.reset();
            context.reset();
            }
           
View Full Code Here

Examples of org.exist.storage.ProcessMonitor

       
        final RestXqServiceCompiledXQueryCache cache = RestXqServiceCompiledXQueryCacheImpl.getInstance();
       
        DBBroker broker = null;
        CompiledXQuery xquery = null;
        ProcessMonitor processMonitor = null;
       
        try {
           
            broker = getBrokerPool().get(getBrokerPool().getSubject());
           
            //ensure we can execute the function before going any further
            checkSecurity(broker, resourceFunction.getXQueryLocation());
           
            //get a compiled query service from the cache
            xquery = cache.getCompiledQuery(broker, resourceFunction.getXQueryLocation());
           
            //find the function that we will execute
            final UserDefinedFunction fn = findFunction(xquery, resourceFunction.getFunctionSignature());
           
            final XQueryContext xqueryContext = xquery.getContext();
           
            //set the request object - can later be used by the EXQuery Request Module
            xqueryContext.setAttribute(EXQ_REQUEST_ATTR, request);
           
            //TODO this is a workaround?
            declareVariables(xqueryContext);
           
            //START workaround: evaluate global variables in modules, as they are reset by XQueryContext.reset()
            final Expression rootExpr = xqueryContext.getRootExpression();
            for(int i = 0; i < rootExpr.getSubExpressionCount(); i++) {
                final Expression subExpr = rootExpr.getSubExpression(i);
                if(subExpr instanceof VariableDeclaration) {
                    subExpr.eval(null);
                }
            }
            //END workaround
           
            //setup monitoring
            processMonitor = broker.getBrokerPool().getProcessMonitor();
            xqueryContext.getProfiler().traceQueryStart();
            processMonitor.queryStarted(xqueryContext.getWatchDog());
           
            //create a function call
            final FunctionReference fnRef = new FunctionReference(new FunctionCall(xqueryContext, fn));
           
            //convert the arguments
            final org.exist.xquery.value.Sequence[] fnArgs = convertToExistFunctionArguments(xqueryContext, fn, arguments);
           
            //execute the function call
            fnRef.analyze(new AnalyzeContextInfo());
            final org.exist.xquery.value.Sequence result = fnRef.evalFunction(null, null, fnArgs);
           
            return new SequenceAdapter(result);
        } catch(final URISyntaxException use) {
            throw new RestXqServiceException(use.getMessage(), use);
        } catch(final PermissionDeniedException pde) {
            throw new RestXqServiceException(pde.getMessage(), pde);
        } catch(final XPathException xpe) {
            throw new RestXqServiceException(xpe.getMessage(), xpe);
        } catch(final EXistException ee) {
            throw new RestXqServiceException(ee.getMessage(), ee);
        } finally {
           
            //clear down monitoring
            if(processMonitor != null) {
                xquery.getContext().getProfiler().traceQueryEnd(xquery.getContext());
                processMonitor.queryCompleted(xquery.getContext().getWatchDog());
            }
           
            //return the broker
            if(broker != null) {
                getBrokerPool().release(broker);
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.