Examples of AgentMain


Examples of org.rhq.enterprise.agent.AgentMain

        }
        theAgent.set(null);
    }

    protected String executePromptCommand(String command) throws Exception {
        AgentMain agent = theAgent.get();
        if (agent == null) {
            throw new IllegalStateException("Embedded agent is not available");
        }

        CharArrayWriter listener = new CharArrayWriter();
        AgentPrintWriter apw = agent.getOut();
        try {
            apw.addListener(listener);
            agent.executePromptCommand(command);
        } catch (Exception e) {
            throw new ExecutionException(listener.toString(), e); // the message is the output, cause is the thrown exception
        } finally {
            apw.removeListener(listener);
        }
View Full Code Here

Examples of org.rhq.enterprise.agent.AgentMain

     *
     * @throws Exception
     */
    @BeforeMethod
    public void start() throws Exception {
        agent = new AgentMain("-p test -l -c test-agent-configuration.xml".split(" "));

        // Before we start the agent, let's start the plugin container ourselves
        // (our test agent configuration has told the agent not to start the PC).
        // We need to do this so we can create our own plugin finder.
        // Starting the PC here, rather than have the agent do it, disables the ability from a remote
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.