Examples of ProcessInfo


Examples of org.jbpm.bpmn2.xml.di.BPMNPlaneHandler.ProcessInfo

                        final Attributes attrs, final ExtensibleXmlParser parser)
            throws SAXException {
        parser.startElementBuilder(localName, attrs);
        final String elementRef = attrs.getValue("bpmnElement");
        NodeInfo nodeInfo = new NodeInfo(elementRef);
        ProcessInfo processInfo = (ProcessInfo) parser.getParent();
        processInfo.addNodeInfo(nodeInfo);
        return nodeInfo;
    }
View Full Code Here

Examples of org.jbpm.bpmn2.xml.di.BPMNPlaneHandler.ProcessInfo

            throws SAXException {
        parser.startElementBuilder(localName, attrs);

        final String elementRef = attrs.getValue("bpmnElement");
        ConnectionInfo info = new ConnectionInfo(elementRef);
        ProcessInfo processInfo = (ProcessInfo) parser.getParent();
        processInfo.addConnectionInfo(info);
        return info;
    }
View Full Code Here

Examples of org.rhq.core.system.ProcessInfo

     * or got refreshed in order to determine if the process was still running.
     *
     * @return information on the resource's process, or null if process was not found
     */
    public ProcessInfo getNativeProcess() {
        ProcessInfo processInfo = null;

        synchronized (trackedProcesses) {
            //right, we've entered the critical section...
            //we might have waited for another thread to actually fill in the tracked processes
            //so let's check again if we really need to run the discovery
View Full Code Here

Examples of org.rhq.core.system.ProcessInfo

        String operand1 = null;
        String operand2 = criteria.getValue();

        for (ProcessInfo process : getProcesses()) {
            ProcessInfo processToMatch; // will be the same as process unless the parent qualifier was provided

            if (qualifier.equals(Qualifier.parent)) {
                processToMatch = getParentProcess(process);
            } else {
                processToMatch = process;
            }

            String[] cmdline = (processToMatch != null) ? processToMatch.getCommandLine() : null;

            if ((cmdline == null) || (cmdline.length == 0)) {
                continue; // no sense continuing with this process - there are no command line arguments
            }
View Full Code Here

Examples of org.rhq.core.system.ProcessInfo

        String operand2;

        String pidfileContentsCache = null; // so we avoid reading the file over and over again

        for (ProcessInfo process : getProcesses()) {
            ProcessInfo processToMatch; // will be the same as process unless the parent qualifier was provided

            if (qualifier.equals(Qualifier.parent)) {
                processToMatch = getParentProcess(process);
            } else {
                processToMatch = process;
            }

            if (attribute.getAttributeValue().equals(Attribute.ProcessCategoryAttributes.name.toString())) {
                operand1 = (processToMatch != null) ? processToMatch.getName() : "";
                operand2 = criteria.getValue();
            } else if (attribute.getAttributeValue().equals(Attribute.ProcessCategoryAttributes.basename.toString())) {
                operand1 = (processToMatch != null) ? processToMatch.getBaseName() : "";
                operand2 = criteria.getValue();
            } else if (attribute.getAttributeValue().equals(Attribute.ProcessCategoryAttributes.pid.toString())) {
                operand1 = (processToMatch != null) ? Long.toString(processToMatch.getPid()) : "";
                operand2 = criteria.getValue();
            } else if (attribute.getAttributeValue().equals(Attribute.ProcessCategoryAttributes.pidfile.toString())) {
                if (pidfileContentsCache == null) {
                    pidfileContentsCache = getPidfileContents(criteria.getValue());
                }

                operand1 = (processToMatch != null) ? String.valueOf(processToMatch.getPid()) : null;
                operand2 = pidfileContentsCache;
            } else {
                throw new IllegalArgumentException(
                    "Criteria with 'process' category must have an attribute of either 'name' or 'basename': "
                        + criteria);
View Full Code Here

Examples of org.rhq.core.system.ProcessInfo

     * @param  child
     *
     * @return the child's parent process or <code>null</code> if the child has no parent
     */
    private ProcessInfo getParentProcess(ProcessInfo child) {
        ProcessInfo parent = null;

        if (child != null) {
            parent = this.allProcesses.get(child.getParentPid());
        }

View Full Code Here

Examples of org.rhq.core.system.ProcessInfo

            LOG.debug("Invoked operation '" + operation + "' on " + resourceContext.getResourceKey() + " (waiting for "
                + desiredState + "), attempt " + i + ": " + res.getComplexResults().getMap().toString());

            //wait for max 30s for the operation to "express" itself
            int w = 0;
            ProcessInfo pi;
            while (w < 30) {
                pi = getResourceContext().getNativeProcess();

                switch (desiredState) {
                case RUNNING:
                    if (pi != null && pi.isRunning()) {
                        return;
                    }
                    break;
                case STOPPED:
                    if (pi == null || !pi.isRunning()) {
                        return;
                    }
                }

                Thread.sleep(1000);
View Full Code Here

Examples of org.rhq.core.system.ProcessInfo

    @Override
    public Configuration loadResourceConfiguration() throws Exception {
        Configuration config = new Configuration();
       
        ProcessInfo pinfo = context.getNativeProcess();
       
        int pid = pinfo == null ? 0 : (int) context.getNativeProcess().getPid();

        LOG.debug("PID = " + pid);
       
View Full Code Here

Examples of org.rhq.core.system.ProcessInfo

            throw new IllegalStateException("Only a single test process is expected but there are " + context.getAutoDiscoveredProcesses().size());
        }

        TestComponent.DISCOVERY_CALLS_COUNT.incrementAndGet();
               
        ProcessInfo pinfo = context.getAutoDiscoveredProcesses().get(0).getProcessInfo();
        return Collections.singleton(new DiscoveredResourceDetails(context.getResourceType(), "KEY", "NAME", "VERSION", null, context.getDefaultPluginConfiguration(), pinfo));
    }
View Full Code Here

Examples of org.rhq.core.system.ProcessInfo

    /**
     * Tests querying technique that is kind of like the one used when we need to autodiscovery Apache.
     */
    public void testPIQLApacheUseCase() {
        ProcessInfo p100 = buildProcessInfo(100, "$1", "--dollararg");
        ProcessInfo p101 = buildProcessInfo(101, 100, "/dollar", "--dollararg");
        ProcessInfo p102 = buildProcessInfo(102, 100, "/dollar", "--dollararg");
        ProcessInfo p200 = buildProcessInfo(200, "/dollar", "--dollararg");
        ProcessInfo p201 = buildProcessInfo(201, 200, "/dollar", "--dollararg");
        ProcessInfo p202 = buildProcessInfo(202, 200, "/dollar", "--dollararg");

        List<ProcessInfo> processes = query.getProcesses();
        processes.add(p100);
        processes.add(p101);
        processes.add(p102);
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.