Package net.jini.lookup

Examples of net.jini.lookup.ServiceDiscoveryManager


            else
                template = new ServiceTemplate(null, interfaces, null);

            if(config==null)
                config = EmptyConfiguration.INSTANCE;
            sdm = new ServiceDiscoveryManager(dm, new LeaseRenewalManager(config), config);
            InstantiatorResource[] irArray = provisioner.getServiceResourceSelector().getInstantiatorResources(svcElement);
            List<ServiceBeanInstance> instanceList = new ArrayList<ServiceBeanInstance>();
            for (InstantiatorResource ir : irArray) {
                try {
                    ServiceBeanInstance[] sbi = ir.getInstantiator().getServiceBeanInstances(svcElement);
View Full Code Here


     * Perform initial discovery in a thread
     */
    public void run() {
        try {
            if(config == null)
                sdm = new ServiceDiscoveryManager(dm, new LeaseRenewalManager());
            else
                sdm = new ServiceDiscoveryManager(dm, new LeaseRenewalManager(config), config);
            lCache = sdm.createLookupCache(template, null, this);
            if(!assignBackup())
                peerLogger.debug("ProvisionMonitorPeer: No backup");
        } catch(Exception e) {
            peerLogger.warn("ProvisionMonitor discovery", e);
View Full Code Here

    @BeforeClass
    public static void init() throws Exception {
        testManager.startReggie();
        testManager.startProvisionMonitor();

        ServiceDiscoveryManager sdm = testManager.getServiceDiscoveryManager();
        ServiceMonitor<ProvisionMonitor> pmMon = new ServiceMonitor<ProvisionMonitor>(sdm, ProvisionMonitor.class);
        pmMon.waitFor(1);
    }
View Full Code Here

        for (int i = 0; i < N; i++) {
            testManager.startCybernode(i);
        }
        logger.info("[" + N + "] Cybernodes have been started");
        if(cyberMon==null) {
            ServiceDiscoveryManager sdm = testManager.getServiceDiscoveryManager();
            cyberMon = new ServiceMonitor<Cybernode>(sdm, Cybernode.class);
        }
        cyberMon.waitFor(N);
    }
View Full Code Here

        // 2. DEPLOY OPSTRING
        testManager.deploy(new File("src/test/resources/opstring/scaling_service_test.groovy"));

        // 3. ASSERTION: ONE SERVICE INSTANCE SHOULD APPEAR
        ServiceDiscoveryManager sdm = testManager.getServiceDiscoveryManager();
        ServiceMonitor<SettableLoadService> servMon = new ServiceMonitor<SettableLoadService>(sdm, SettableLoadService.class);
        servMon.waitFor(1);
        Assert.assertEquals((long)1, (long)servMon.getCount());

        // 4. GRADUALLY INCREASE LOAD. THE SERVICE SHOULD SCALE UP
View Full Code Here

        // 2. DEPLOY OPSTRING
        testManager.deploy(new File("src/test/resources/opstring/scaling_service_test.groovy"));

        // 3. ASSERTION: ONE SERVICE INSTANCE SHOULD APPEAR
        ServiceDiscoveryManager sdm = testManager.getServiceDiscoveryManager();
        ServiceMonitor<SettableLoadService> servMon = new ServiceMonitor<SettableLoadService>(sdm, SettableLoadService.class);
        servMon.waitFor(1);
        Assert.assertEquals((long)1, (long)servMon.getCount());

        // 4. GRADUALLY INCREASE LOAD. THE SERVICE SHOULD SCALE UP
View Full Code Here

            testManager.startCybernode(i);
        }
        logger.info("[" + N + "] Cybernodes and "
                  + "[" + N + "] Provision Monitors have been started");

        ServiceDiscoveryManager sdm = testManager.getServiceDiscoveryManager();
        ServiceMonitor<Cybernode> cyMon = new ServiceMonitor<Cybernode>(sdm, Cybernode.class);
        ServiceMonitor<ProvisionMonitor> pmMon = new ServiceMonitor<ProvisionMonitor>(sdm, ProvisionMonitor.class);
        cyMon.waitFor(N);
        pmMon.waitFor(N);
View Full Code Here

        // If there are more than 4 hosts participating in the test, we
        // want to have as many iterations as hosts. Otherwise we want
        // to have 4 iterations in order to have meaningful test.
        final int N = Math.max(4, testManager.getHostList().size());

        ServiceDiscoveryManager sdm = testManager.getServiceDiscoveryManager();

        // 1. START PROVISION MONITOR
        logger.info("Starting Provision Monitor ...");
        //ProvisionMonitor pm = testManager.startProvisionMonitor(-1);
        testManager.startProvisionMonitor(-1);
View Full Code Here

            testManager.startProvisionMonitor();
            final int N = Math.max(testManager.getHostList().size(), 2);
            for (int i = 0; i < N; i++) {
                testManager.startCybernode(i);
            }
            ServiceDiscoveryManager sdm = testManager.getServiceDiscoveryManager();
            cyberMon = new ServiceMonitor<Cybernode>(sdm, Cybernode.class);
            cyberMon.waitFor(N);

            pmMon = new ServiceMonitor<ProvisionMonitor>(sdm, ProvisionMonitor.class);
            pmMon.waitFor(1);
View Full Code Here

            //testManager.startProvisionMonitor();
            final int N = Math.max(testManager.getHostList().size(), 2);
            for (int i = 0; i < N; i++) {
                testManager.startCybernode(i);
            }
            ServiceDiscoveryManager sdm = testManager.getServiceDiscoveryManager();
            pmMon = new ServiceMonitor<ProvisionMonitor>(sdm, ProvisionMonitor.class);
            pmMon.waitFor(1);
            cyberMon = new ServiceMonitor<Cybernode>(sdm, Cybernode.class);
            cyberMon.waitFor(N);
        }
View Full Code Here

TOP

Related Classes of net.jini.lookup.ServiceDiscoveryManager

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.