Package org.rhq.enterprise.communications

Examples of org.rhq.enterprise.communications.ServiceContainer.start()


            ServiceContainer container = (null == m_container) ? new ServiceContainer() : m_container;
            AutoDiscoveryListener listener = new ServerAutoDiscoveryListener(m_knownAgents);
            container.addDiscoveryListener(listener);

            container.start(config.getServiceContainerPreferences().getPreferences(), config
                .getClientCommandSenderConfiguration(), m_mbs);

            // now let's add our additional handler to support the remote clients (e.g. CLI)
            m_remoteApiHandler = new RemoteSafeInvocationHandler();
            m_remoteApiHandler.registerMetricsMBean(container.getMBeanServer());
View Full Code Here


            + ServiceContainerConfigurationConstants.CURRENT_CONFIG_SCHEMA_VERSION);
        prefs.put(ServiceContainerConfigurationConstants.DATA_DIRECTORY, "target");
        prefs.remove(ServiceContainerConfigurationConstants.GLOBAL_CONCURRENCY_LIMIT); // make sure we do not have a global limit

        ServiceContainer sc = new ServiceContainer();
        sc.start(prefs, new ClientCommandSenderConfiguration());
        Map<String, Integer> map = sc.getConcurrencyManager().getAllConfiguredNumberOfPermitsAllowed();
        map.put("limited", 10);
        sc.setConcurrencyManager(new ConcurrencyManager(map));

        Thread.sleep(5000);
View Full Code Here

            + ServiceContainerConfigurationConstants.CURRENT_CONFIG_SCHEMA_VERSION);
        prefs.put(ServiceContainerConfigurationConstants.DATA_DIRECTORY, "target");
        prefs.remove(ServiceContainerConfigurationConstants.GLOBAL_CONCURRENCY_LIMIT); // make sure we do not have a global limit

        ServiceContainer sc = new ServiceContainer();
        sc.start(prefs, new ClientCommandSenderConfiguration());
        Map<String, Integer> map = sc.getConcurrencyManager().getAllConfiguredNumberOfPermitsAllowed();
        map.put("limitedTimeout", 10);
        sc.setConcurrencyManager(new ConcurrencyManager(map));
        Thread.sleep(5000);
View Full Code Here

            + ServiceContainerConfigurationConstants.CURRENT_CONFIG_SCHEMA_VERSION);
        prefs.put(ServiceContainerConfigurationConstants.DATA_DIRECTORY, "target");
        prefs.remove(ServiceContainerConfigurationConstants.GLOBAL_CONCURRENCY_LIMIT); // make sure we do not have a global limit

        ServiceContainer sc = new ServiceContainer();
        sc.start(prefs, new ClientCommandSenderConfiguration());
        Thread.sleep(5000);

        AtomicInteger counter = new AtomicInteger(0);
        CountDownLatch latch = new CountDownLatch(1);
        LimitedConcurrencyPojo pojoImpl = new LimitedConcurrencyPojo(counter, latch);
View Full Code Here

            + ServiceContainerConfigurationConstants.CURRENT_CONFIG_SCHEMA_VERSION);
        prefs.put(ServiceContainerConfigurationConstants.DATA_DIRECTORY, "target");
        prefs.put(ServiceContainerConfigurationConstants.GLOBAL_CONCURRENCY_LIMIT, "5");

        ServiceContainer sc = new ServiceContainer();
        sc.start(prefs, new ClientCommandSenderConfiguration());
        Thread.sleep(5000);

        AtomicInteger counter = new AtomicInteger(0);
        CountDownLatch latch = new CountDownLatch(1);
        LimitedConcurrencyPojo pojoImpl = new LimitedConcurrencyPojo(counter, latch);
View Full Code Here

            + ServiceContainerConfigurationConstants.CURRENT_CONFIG_SCHEMA_VERSION);
        prefs.put(ServiceContainerConfigurationConstants.DATA_DIRECTORY, "target");
        prefs.put(ServiceContainerConfigurationConstants.CMDSERVICES, EchoCommandService.class.getName());

        ServiceContainer sc = new ServiceContainer();
        sc.start(prefs, new ClientCommandSenderConfiguration());
        Thread.sleep(5000);

        try {
            // numberOfRetries tells jboss remoting effectively the number of seconds before declaring "cannot connect"
            RemoteCommunicator comm = new JBossRemotingRemoteCommunicator(
View Full Code Here

            assert callback.response == null : "Server was shut down, and we should have retried forever; should not have received a response yet: "
                + callback.response;

            // now restart the server and the command should immediately get triggered
            synchronized (callback) {
                sc.start(prefs, new ClientCommandSenderConfiguration());
                callback.wait(5000); // should get notified very fast, probably within a second
            }

            assert callback.response != null : "Command should have been finished by now";
            assert callback.response.isSuccessful() : "Command should have been successful: " + callback.response;
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.