Package org.apache.ace.agent

Examples of org.apache.ace.agent.ManagementAgentFactory


     *
     */
    public void testOneAgentConfiguration() throws Exception {

        // agent factory should be up
        ManagementAgentFactory agentFactory = getService(ManagementAgentFactory.class);
        Assert.assertNotNull(agentFactory);

        assertAgentDown("007");

        // configure an agent
        Map<String, String> config = new Hashtable<String, String>();
        config.put("verbose", "true");
        config.put("agents", "007");
        config.put("serverurl", "http://localhost:8080");
        config.put("logstores", "auditlog");
        agentFactory.updated(config);

        assertAgentUp("007");

        config = new Hashtable<String, String>();
        config.put("verbose", "true");
        agentFactory.updated(config);

        assertAgentDown("007");
    }
View Full Code Here


     *
     */
    public void testTwoAgentsConfiguration() throws Exception {

        // agent factory should be up
        ManagementAgentFactory agentFactory = getService(ManagementAgentFactory.class);
        Assert.assertNotNull(agentFactory);

        assertAgentDown("007");
        assertAgentDown("009");

        // configure an agent
        Map<String, String> config = new Hashtable<String, String>();
        config.put("verbose", "true");
        config.put("agents", "007,009");
        config.put("serverurl", "http://localhost:8080");
        config.put("logstores", "auditlog");
        agentFactory.updated(config);

        assertAgentUp("007");
        assertAgentUp("009");

        config = new Hashtable<String, String>();
        config.put("verbose", "true");
        agentFactory.updated(config);

        assertAgentDown("007");
        assertAgentDown("009");
    }
View Full Code Here

            if (m_verbose)
                System.out.println("Configuring Management Agent.. " + m_configuration);
            BundleContext context = framework.getBundleContext();
            ServiceReference[] references = context.getServiceReferences(ManagementAgentFactory.class.getName(), null);
            if (references != null) {
                ManagementAgentFactory service = (ManagementAgentFactory) context.getService(references[0]);
                service.updated(m_configuration);
                context.ungetService(references[0]);
            }
            else {
                System.err.println("Can not find Management Agent config service! Aborting..");
                System.exit(1);
View Full Code Here

TOP

Related Classes of org.apache.ace.agent.ManagementAgentFactory

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.