Package org.rhq.enterprise.agent

Examples of org.rhq.enterprise.agent.AgentMain$BootstrapLatchCommandListener


            }
        }
    }

    protected boolean isAgentStarted() {
        AgentMain agent = theAgent.get();
        return (agent != null && agent.isStarted());
    }
View Full Code Here


            String[] args = new String[3];
            args[0] = "--daemon";
            args[1] = "--pref=" + configSetup.getPreferencesNodeName();
            args[2] = "--output=" + new File(env.getServerLogDir(), "embedded-agent.out").getAbsolutePath();

            theAgent.set(new AgentMain(args));

            agentThread = new Thread("Embedded Agent Start Thread") {
                public void run() {
                    try {
                        theAgent.get().start();
View Full Code Here

        }
        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

     *
     * @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

Related Classes of org.rhq.enterprise.agent.AgentMain$BootstrapLatchCommandListener

Copyright © 2018 www.massapicom. 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.