Package net.jini.core.lookup

Examples of net.jini.core.lookup.ServiceRegistrar


        Class<?>[] classes = new Class<?>[] {net.jini.space.JavaSpace.class};
        Name sn = new Name(spaceName);
        ServiceTemplate tmpl = new ServiceTemplate(null/* serviceID */, classes, new Entry[] {sn});

        LookupLocator locator = new LookupLocator(url); // <protocol>://<hostname>
        ServiceRegistrar sr = locator.getRegistrar();
        JavaSpace space = (JavaSpace) sr.lookup(tmpl);

        return space;
    }
View Full Code Here


        Class<?>[] classes = new Class<?>[] {net.jini.space.JavaSpace.class};
        Name sn = new Name(spaceName);
        ServiceTemplate tmpl = new ServiceTemplate(null/* serviceID */, classes, new Entry[] {sn});

        LookupLocator locator = new LookupLocator(url); // <protocol>://<hostname>
        ServiceRegistrar sr = locator.getRegistrar();
        JavaSpace space = (JavaSpace) sr.lookup(tmpl);

        return space;
    }
View Full Code Here

        // Name sn = new Name("*");
        ServiceTemplate tmpl = new ServiceTemplate(null, classes, new Entry[] {});

        // Creating a lookup locator
        LookupLocator locator = new LookupLocator(uri);
        ServiceRegistrar sr = locator.getRegistrar();

        TransactionManager tm = (TransactionManager) sr.lookup(tmpl);
        return tm;
    }
View Full Code Here

    private boolean isNotFirstDiscovery;

    public void discovered(final DiscoveryEvent evt) {
        final ServiceRegistrar[] registrarsArray = evt.getRegistrars();
        ServiceRegistrar registrar;
        for (int n = 0; n < registrarsArray.length; n++) {
            incrementRegCount();
            registrar = registrarsArray[n];
            logRegistration(registrar);
            LOG.debug("Registered with registrar: " + registrar.getServiceID());
        }
        if (!isNotFirstDiscovery) {
            LOG.info("BuildAgentService open for business...");
            isNotFirstDiscovery = true;
        }
View Full Code Here

        }
    }

    public void discarded(final DiscoveryEvent evt) {
        final ServiceRegistrar[] registrarsArray = evt.getRegistrars();
        ServiceRegistrar registrar;
        for (int n = 0; n < registrarsArray.length; n++) {
            decrementRegCount();
            registrar = registrarsArray[n];
            LOG.debug("Discarded registrar: " + registrar.getServiceID());
        }
    }
View Full Code Here

                Thread.sleep(5000);
            } catch (InterruptedException e1) {
            }
            ServiceRegistrar[] registrars = discovery.getRegistrars();
            for (int x = 0; x < registrars.length; x++) {
                ServiceRegistrar registrar = registrars[x];
                String registrarInfo = "Registrar: " + registrar.getServiceID();
                System.out.println();
                System.out.println(registrarInfo);
                LOG.debug(registrarInfo);
                ServiceTemplate template = new ServiceTemplate(null, null, null);
                ServiceMatches matches = registrar.lookup(template, Integer.MAX_VALUE);
                ServiceItem[] items = matches.items;
                for (int i = 0; i < items.length; i++) {
                    String serviceInfo = "  Service: " + items[i].service;
                    System.out.println(serviceInfo);
                    LOG.debug(serviceInfo);
View Full Code Here

     * 2. Deploy cc-agent.war to a web server.
     * 3. Manually launch agent via webstat (http://localhost:8080/cc-agent/agent.jnlp).
     * 4. Manually run this test.
     */
    public void manual_testRestart() throws Exception {
        final ServiceRegistrar reg = DistributedMasterBuilderTest.findTestLookupService(20);
        assertNotNull("Couldn't find registrar.", reg);

        final Entry[] entries = SearchablePropertyEntries.getPropertiesAsEntryArray(
                new SearchablePropertyEntries(
                        BuildAgentServiceImplTest.TEST_USER_DEFINED_PROPERTIES_FILE).getProperties()
View Full Code Here

        assertNotNull(agentService2.getMachineName());
        agentService2.kill(false);
    }

    public void testKillNoUI() throws Exception {
        ServiceRegistrar reg = DistributedMasterBuilderTest.findTestLookupService(20);
        assertNotNull("Couldn't find registrar.", reg);
        findAgent(reg, 3, false);

        final Thread t = new Thread() {
            public void run() {
View Full Code Here

        findAgent(reg, 10, false);
    }

    // @todo Find way to skip this test if we are running in a "headless" environment
    public void xxx_testKill() throws Exception {
        ServiceRegistrar reg = DistributedMasterBuilderTest.findTestLookupService(20);
        assertNotNull("Couldn't find registrar.", reg);
        findAgent(reg, 3, false);

        final Thread t = new Thread() {
            public void run() {
View Full Code Here

                + ". Make sure this file is in the classes (bin) directory.",
            policyFile);
        System.setProperty(BuildAgent.JAVA_SECURITY_POLICY, policyFile.toExternalForm());
        ReggieUtil.setupRMISecurityManager();

        ServiceRegistrar serviceRegistrar = findTestLookupService(20);
        assertNotNull("Failed to start local lookup _service.", serviceRegistrar);
        assertEquals("Unexpected local lookup _service host",
            InetAddress.getLocalHost().getCanonicalHostName(),
            serviceRegistrar.getLocator().getHost());

        Thread.sleep(1000); // kludged attempt to avoid occaisional test failures
        return newJiniProcess;
    }
View Full Code Here

TOP

Related Classes of net.jini.core.lookup.ServiceRegistrar

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.