Package org.apache.ace.agent

Examples of org.apache.ace.agent.AgentControl


            "authentication.enabled", "false");

        Map<String, String> props = new HashMap<String, String>();
        props.put(AgentConstants.CONFIG_DISCOVERY_SERVERURLS, serverURL);

        AgentControl agentControl = getService(AgentControl.class);
        agentControl.getConfigurationHandler().putAll(props);
    }
View Full Code Here


* for a handler are published the highest ranked should be used.
*/
public class AgentExtensionTest extends BaseAgentTest {

    public void testLifecycle() throws Exception {
        AgentControl agentControl = getService(AgentControl.class);
        assertNotNull(agentControl);

        getAgentBundle().stop();
        System.setProperty(AgentConstants.CONFIG_IDENTIFICATION_DISABLED, "true");
        System.setProperty(AgentConstants.CONFIG_DISCOVERY_DISABLED, "true");
View Full Code Here

    /**
     * Tests that we can install upgrades for an earlier installed DP.
     */
    public void testGetSizeEstimateForDeploymentPackage() throws Exception {
        AgentControl control = getService(AgentControl.class);

        Map<String, String> props = createAgentConfiguration(false /* useStreaming */, 1000 /* secs */);

        ConfigurationHandler configurationHandler = control.getConfigurationHandler();
        configurationHandler.putAll(props);

        // Allow configuration to propagate...
        Thread.sleep(100L);

        synchronized (m_servlet) {
            m_servlet.reset();
        }

        waitForInstalledVersion(Version.emptyVersion);

        synchronized (m_servlet) {
            m_servlet.addPackage(m_package1);
            m_servlet.addPackage(m_package2);
            m_servlet.addPackage(m_package6);
        }

        DeploymentHandler deploymentHandler = control.getDeploymentHandler();
        // the size is (major-version # - 2)...
        assertEquals(4, deploymentHandler.getSize(V6_0_0, false));
        assertEquals(0, deploymentHandler.getSize(V2_0_0, false));
        assertEquals(-1, deploymentHandler.getSize(V1_0_0, false));
    }
View Full Code Here

        waitForInstalledVersion(dpackage.getVersion());
    }

    private void setupAgentForNonStreamingDeployment() throws Exception {
        AgentControl control = getService(AgentControl.class);

        Map<String, String> props = createAgentConfiguration(false /* useStreaming */, 1 /* sec */);

        ConfigurationHandler configurationHandler = control.getConfigurationHandler();
        configurationHandler.putAll(props);

        synchronized (m_servlet) {
            m_servlet.reset();
        }
View Full Code Here

        waitForInstalledVersion(Version.emptyVersion);
    }

    private void setupAgentForStreamingDeployment() throws Exception {
        AgentControl control = getService(AgentControl.class);

        Map<String, String> props = createAgentConfiguration(true /* useStreaming */, 1 /* sec */);

        ConfigurationHandler configurationHandler = control.getConfigurationHandler();
        configurationHandler.putAll(props);

        waitForInstalledVersion(Version.emptyVersion);
    }
View Full Code Here

    private void waitForInstalledVersion(Version version) throws Exception {
        ServiceReference reference = m_bundleContext.getServiceReference(AgentControl.class.getName());

        try {
            AgentControl control = (AgentControl) m_bundleContext.getService(reference);
            DeploymentHandler deploymentHandler = control.getDeploymentHandler();

            int timeout = 100;
            while (!deploymentHandler.getInstalledVersion().equals(version)) {
                Thread.sleep(100);
                if (timeout-- <= 0) {
View Full Code Here

TOP

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

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.