Examples of Process


Examples of org.jboss.fresh.shell.impl.Process

      return;
    }

    if (outproc != null) {
      SystemShellImpl ss = (SystemShellImpl) ((ShellImpl) getShell()).getSystemShell();
      Process proc = ss.findProcess(outproc);
      if (proc == null) {
        Map m = ss.getShellMap();
        Iterator it = m.entrySet().iterator();
        while (it.hasNext()) {
          Map.Entry ent = (Map.Entry) it.next();
          ShellImpl shel = (ShellImpl) ent.getValue();
          Map procs = shel.getProcesses();
          proc = (Process) procs.get(outproc);
          if (proc != null) break;
        }

        if (proc == null) {
          error("No process for id: " + outproc);
          return;
        }
      }

      Object outb = proc.getOutputBuffer();
      pout.println("Out buffer: " + outb + " [" + (outb == null ? "" : outb.getClass().getName()) + "]");

      if (outb instanceof BufferImpl) {
        List ls = ((BufferImpl) outb).getBufferCopy();
        pout.println("\nContent: ");
        pout.println(ls);
      }

      pout.flush();
      return;
    }

    if(fullThreadDump) {
      Set allTraces = Thread.getAllStackTraces().entrySet();
      Iterator it = allTraces.iterator();
      while(it.hasNext()) {
        Map.Entry ent = (Map.Entry) it.next();

        Thread key = (Thread) ent.getKey();
        StackTraceElement [] traces = (StackTraceElement []) ent.getValue();

        boolean netlight = false;
        boolean plain = false;
        boolean highlight = key.getState() != Thread.State.BLOCKED && key.getState() != Thread.State.TIMED_WAITING && key.getState() != Thread.State.WAITING;
        if(highlight && traces.length > 0 &&
          (("java.net.PlainSocketImpl".equals(traces[0].getClassName())
            && "socketAccept".equals(traces[0].getMethodName()))
          || ("java.net.SocketInputStream".equals(traces[0].getClassName())
            && "socketRead0".equals(traces[0].getMethodName())))
              ) {
          netlight = true;
        }

        if(netlight) {
          pout.print("\u001B[0;36m");
        } else if(traces.length == 0) {
          highlight = true;
          pout.print("\u001B[0;31m");
        } else if(highlight) {
          plain = true;
          pout.print("\u001B[1;33m");
        }

        pout.println(ent.getKey());

        if(plain) {
          pout.print("\u001B[0m\u001B[0;33m");
        }

        for(int i=0; i<traces.length; i++) {
          pout.println("    " + traces[i]);
        }

        if(highlight)
          pout.print("\u001B[0m");

      }
      pout.flush();
      return;
    }

    if (order != null) {
      try {
        comptor = new TableComparator(order, (alles ? COLS_LONG : COLS_SHORT));
        rows = new TreeSet(comptor);
      } catch (Exception ex) {
        error(ex.getMessage());
        return;
      }
    }

    //print("Processes: ");
    // Let's list all info for all processes first

/*
    Map m = ((ShellImpl) getShell()).getProcesses();
    Iterator it = m.entrySet().iterator();
    print("pID\tTime\tActive\tDone\tsessID\tType\tCmd\tErr");
    while (it.hasNext()) {
      Map.Entry me = (Map.Entry) it.next();
      //log.debug("Key: " + me.getKey());
      Process p = (Process) me.getValue();
      print(p.getID() + "\t" +
          elapsedTime(p.getStartTime()) + "\t" +
          !p.isFinished() + "\t" +
          p.canDispose() + "\t" +
          getShell().getSessionID() + "\t" +
          p.getClass().getName() + "\t" +
          p.getCommandLine() + "\t" +
          p.getThrowable());
    }
*/
    //print("Sessions:");
    int idlen = longForm ? 40 : 10;


    if (alles) {
      fmt = new LineFormat(new int[]{idlen, idlen, 8, 8, 8, 5, 8, 7, 15, 3}, new String[]{"l", "l", "l", "l", "l", "l", "l", "l", "l"}, new int[]{0, 2, 2, 2, 2, 2, 2, 2, 2, 2});
      print(fmt.print(COLS_LONG), 0);
    } else {
      fmt = new LineFormat(new int[]{idlen, idlen, 8, 8, 8, 3}, new String[]{"l", "l", "l", "l", "l", "l"}, new int[]{0, 2, 2, 2, 2, 2});
      print(fmt.print(COLS_SHORT), 0);
    }

    //print("\n");

    Iterator it = null;
    Map procMap = null;
    if (xall) {
      procMap = ((SystemShellImpl) ((ShellImpl) getShell()).getSystemShell()).getShellMap();
      //it = m.entrySet().iterator();
    } else {
      procMap = new HashMap();
      procMap.put("0", getShell());
      //it = m.entrySet().iterator();
    }

    HashSet singles = new HashSet();

    // prepare hierarchies
    it = procMap.entrySet().iterator();
    while(it.hasNext()) {
      Map.Entry ent = (Map.Entry)it.next();
      ShellImpl shel = (ShellImpl) ent.getValue();
      singles.add(shel);

      Map pcs = shel.getProcesses();
      Iterator it2 = pcs.entrySet().iterator();
      while (it2.hasNext()) {
        Map.Entry me2 = (Map.Entry) it2.next();
        //log.debug("Key: " + me.getKey());
        if ("0".equals(me2.getKey())) continue;

        Process p = (Process) me2.getValue();
        if(p.getParent() != null) {
          List childls = (List) parentMap.get(p.getParent().getID());
          if(childls == null) {
            childls = new LinkedList();
            parentMap.put(p.getParent().getID(), childls);
          }
          childls.add(p);
        } else {
          List childls = (List) parentMap.get(shel.getSessionID());
          if(childls == null) {
View Full Code Here

Examples of org.jbpm.process.core.Process

                    "org.drools.eclipse.processExtension");
            for (IConfigurationElement element: extensions) {
                try {
                    ProcessExtension processExtension = (ProcessExtension)
                        element.createExecutableExtension("className");
                    Process process = (Process) processInfo.getProcess();
                    if (processExtension.acceptsProcess(process.getType())) {
                        ProcessEditPartFactory editPartFactory = processExtension.getProcessEditPartFactory();
                        editPartFactory.setProject(javaProject);
                        graphicalViewer.setEditPartFactory(editPartFactory);
                        ProcessWrapper processWrapper = processExtension.getProcessWrapperBuilder().getProcessWrapper(process, javaProject);
                        graphicalViewer.setContents(processWrapper);
View Full Code Here

Examples of org.kie.api.definition.process.Process

        //Merge The Rule Flows
        if (newPkg.getRuleFlows() != null) {
            final Map flows = newPkg.getRuleFlows();
            for (Object o : flows.values()) {
                final Process flow = (Process) o;
                pkg.addProcess(flow);
            }
        }

    }
View Full Code Here

Examples of org.kie.api.definition.process.Process

        //Merge The Rule Flows
        if (newPkg.getRuleFlows() != null) {
            final Map flows = newPkg.getRuleFlows();
            for (Object o : flows.values()) {
                final Process flow = (Process) o;
                pkg.addProcess(flow);
            }
        }

    }
View Full Code Here

Examples of org.kie.api.definition.process.Process

        //Merge The Rule Flows
        if ( newPkg.getRuleFlows() != null ) {
            final Map flows = newPkg.getRuleFlows();
            for ( Object o : flows.values() ) {
                final Process flow = (Process) o;
                pkg.addProcess( flow );
            }
        }

    }
View Full Code Here

Examples of org.kie.definition.process.Process

        }
        this.eventSupport.fireAfterProcessAdded( process );
    }

    public void removeProcess( final String id ) {
        Process process = this.processes.get( id );
        if (process == null) {
            throw new IllegalArgumentException( "Process '" + id + "' does not exist for this Rule Base." );
        }
        this.eventSupport.fireBeforeProcessRemoved( process );
        lock();
        try {
            this.processes.remove( id );
            this.pkgs.get(process.getPackageName()).removeRuleFlow(id);
        } finally {
            unlock();
        }
        this.eventSupport.fireAfterProcessRemoved( process );
    }
View Full Code Here

Examples of org.openbravo.model.ad.ui.Process

  public void doPost(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {

    VariablesSecureApp vars = new VariablesSecureApp(request);

    final Process HBProcess = OBDal.getInstance().get(Process.class, HB_Process_ID);
    final SystemInformation sysInfo = OBDal.getInstance().get(SystemInformation.class,
        SystemInfomation_ID);
    final boolean isHearbeatEnabled = sysInfo.isEnableHeartbeat() == null ? false : sysInfo
        .isEnableHeartbeat();

    final String clickedButton = vars.getStringParameter("inpLastFieldChanged");

    if (isHearbeatEnabled || clickedButton.equalsIgnoreCase("inpisheartbeatactive")) {
      // Disable Heartbeat
      try {

        if (sysInfo.isEnableHeartbeat() != null && sysInfo.isEnableHeartbeat()) {
          // Sending beat
          ProcessBundle beat = new ProcessBundle(HB_Process_ID, vars).init(this);
          new ProcessRunner(beat).execute(this);
        }

        // Deactivating the process at SystemInfo
        sysInfo.setEnableHeartbeat(false);
        sysInfo.setTestHeartbeat("N");
        OBDal.getInstance().save(sysInfo);

        // Un-scheduling the process
        final OBCriteria<ProcessRequest> prCriteria = OBDal.getInstance().createCriteria(
            ProcessRequest.class);
        prCriteria.add(Expression.eq(ProcessRequest.PROPERTY_PROCESS, HBProcess));
        prCriteria
            .add(Expression.eq(ProcessRequest.PROPERTY_CHANNEL, Channel.SCHEDULED.toString()));
        final List<ProcessRequest> requestList = prCriteria.list();

        if (requestList.size() != 0) {

          final ProcessRequest pr = requestList.get(0);

          OBDal.getInstance().save(pr);
          OBDal.getInstance().commitAndClose();

          final ProcessBundle bundle = ProcessBundle.request(pr.getId(), vars, this);

          OBScheduler.getInstance().unschedule(pr.getId(), bundle.getContext());
        }

        String msg = Utility.messageBD(this, "HB_SUCCESS", vars.getLanguage());
        advisePopUpRefresh(request, response, "SUCCESS", "Heartbeat Configuration", msg);

      } catch (Exception e) {
        log4j.error(e.getMessage(), e);
        advisePopUpRefresh(request, response, "ERROR", "Heartbeat Configuration", e.getMessage());
      }

    } else { // Enable Heartbeat

      try {

        HBProcess.setActive(true);
        OBDal.getInstance().save(HBProcess);

        OBDal.getInstance().commitAndClose();

        // Sending beat
View Full Code Here

Examples of org.rzo.yajsw.os.Process

    /*
     * WindowsXPProcess p = new WindowsXPProcess(); p.setCommand("notepad");
     * p.setUser("test\\yajsw"); p.setPassword("yajsw"); p.start();
     */
    // getProcess(3332);
    Process p = new WindowsXPProcess();
    // p.setCommand("ping 127.0.0.1");
    p.setCommand("set.bat");
    List<String[]> env = OperatingSystem.instance().processManagerInstance().getProcess(
        OperatingSystem.instance().processManagerInstance().currentProcessId()).getEnvironment();
    p.setEnvironment(env);
    System.out.println(p.getEnvironmentAsMap().get("Path"));
    System.out.println(env.get(0)[0]);
    p.setPipeStreams(true, false);
    p.start();
    String line = null;
    int k = 0;
    try
    {
      InputStreamReader isr = new InputStreamReader(p.getInputStream());
      BufferedReader br = new BufferedReader(isr);
      line = br.readLine();
      System.out.println(line);
      while (k < 30 && line != null)
      {
View Full Code Here

Examples of org.rzo.yajsw.os.Process

    setState(STATE_SHUTDOWN);
  }

  public void osProcessTerminated()
  {
    Process process = _osProcess;
    if (process != null)
      _exitCode = process.getExitCode();
  }
View Full Code Here

Examples of org.rzo.yajsw.os.Process

  {
    if (config == null)
      return null;
    String wrapperConfFileName = config.getCachedPath(false);

    final Process _osProcess = OperatingSystem.instance().processManagerInstance().createProcess();

    try
    {
      _osProcess.setCommand(new String[]
      { getJava(), "-cp", WrapperLoader.getWrapperHome() + "/wrapper.jar", TrayIconMainBooter.class.getName(), wrapperConfFileName });
      _osProcess.setPipeStreams(false, false);
      _osProcess.setVisible(false);
      _osProcess.start();
      Runtime.getRuntime().addShutdownHook(new Thread()
      {
        public void run()
        {
          if (_osProcess != null)
            _osProcess.kill(0);
        }
      });
      return _osProcess;
    }
    catch (Exception e)
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.