Package net.jini.discovery

Examples of net.jini.discovery.LookupDiscovery$UnicastDiscoveryTask


    Entry[] attrs = new Entry[]
      { new BasicServiceType(serviceType) };
    _serviceTemplate = new ServiceTemplate(null, null, attrs);
   
    // set up for discovery
    LookupDiscovery disco = new LookupDiscovery(_groups);
    disco.addDiscoveryListener(new Discoverer());
  }
View Full Code Here


     * </ul>
     */
    public void run() throws Exception {
        logger.log(Level.FINE, "run()");
        try {
            LookupDiscovery newLD = new LookupDiscovery
                                        (DiscoveryGroupManagement.ALL_GROUPS,
           getConfig().getConfiguration());
            lookupDiscoveryList.add(newLD);
            String[] oldGroups = newLD.getGroups();
            logger.log(Level.FINE, "current groups lookup "
                              +"discovery is configured to discover --");
            GroupsUtil.displayGroupSet(oldGroups,"  curGroup",
                                       Level.FINE);
            /* Attempt to add a finite set of groups to the original set */
            logger.log(Level.FINE, "invoking addGroups to augment "
                              +"the groups to discover with --");
            GroupsUtil.displayGroupSet(groupsToDiscover,"  newGroups",
                                       Level.FINE);
            newLD.addGroups(groupsToDiscover);
        } catch(UnsupportedOperationException e) {
            logger.log(Level.FINE, "UnsupportedOperationException "
                              +"on attempt to augment ALL_GROUPS as expected");
            return;
        }
View Full Code Here

                buff.append(addresses[i]).append(" ");
            }
            logger.log(Level.INFO, buff.toString());
            startReggie();
            Thread.currentThread().sleep(10000);
            LookupDiscovery ld = new LookupDiscovery(
                new String[]{
                    "com.sun.jini.test.impl.reggie.MultihomedClientTest"},
                ConfigurationProvider.getInstance(new String[]{
                    System.getProperty("lookupConfig")}));
            Driver driver = new Driver();
            ld.addDiscoveryListener(driver);
            ServiceRegistrar[] registrars = ld.getRegistrars();
            for (int i=0; i < registrars.length; i++) {
                driver.done = true;
                System.out.println(registrars[i]);
            }
            int timeout =
View Full Code Here

 
  String[] groups = {InetAddress.getLocalHost().getHostName() + "_ud_" +
         System.currentTimeMillis()};
 
  for (int i = 0; i < NUMLD; i++) {
      ldArray[i] = new LookupDiscovery(groups, config);
  }
  Thread t = new AcceptThread();
  t.start();
  // Wait for AcceptThread to set up its socket.
  Thread.sleep(1000);
View Full Code Here

  t.start();
  // Wait for AcceptThread to set up its socket.
  Thread.sleep(1000);
  long startTime = System.currentTimeMillis();
  for (int i = 0; i < NUMLD; i++) {
      ldArray[i] = new LookupDiscovery(
        new String[] {
      InetAddress.getLocalHost().getHostName() + "_mrd_" +
        System.currentTimeMillis()
        },
        config);
View Full Code Here

  logger.log(Level.FINE, "creating a new "
       +"LookupDiscovery initially configured to "
       +"discover -- ");
  GroupsUtil.displayGroupSet(configGroups,"  configGroups",
           Level.FINE);
  newLD = new LookupDiscovery(configGroups,
            sysConfig.getConfiguration());
  lookupDiscoveryList.add(newLD);
    }//end setup
View Full Code Here

        /* Create LookupDiscovery instance configured for ALL_GROUPS */
        logger.log(Level.FINE,
                          "constructing a new LookupDiscovery "
                          +"to discover -- ");
        logger.log(Level.FINE, "   ALL_GROUPS");
        LookupDiscovery newLD = new LookupDiscovery
                                    (DiscoveryGroupManagement.ALL_GROUPS,
             getConfig().getConfiguration());
        lookupDiscoveryList.add(newLD);
        /* Verify discovery - set the expected groups to discover */
        mainListener.setLookupsToDiscover(allLookupsToStart);
        /* Add the listener to the LookupDiscovery utility */
        newLD.addDiscoveryListener(mainListener);
        /* Wait for the discovery of the expected lookup service(s) */
        waitForDiscovery(mainListener);
    }//end run
View Full Code Here

         * (NO_GROUPS) as the input to the constructor.
         */
        logger.log(Level.FINE,
                       "creating a new LookupDiscovery with input = "
                          +constStr);
        LookupDiscovery ld = new LookupDiscovery
                                     (DiscoveryGroupManagement.NO_GROUPS,
              getConfig().getConfiguration());
        lookupDiscoveryList.add(ld);
        /* Add a listener to the lookup discovery utility created above,
         * and verify the listener receives no events.
         */
        mainListener.clearAllEventInfo();//listener expects no events
        ld.addDiscoveryListener(mainListener);
        waitForDiscovery(mainListener);
        /* Re-configure the listener to expect events for the lookups
         * started during setup.
         */
        logger.log(Level.FINE, "calling "+methodStr
                          +" to change the groups to discover to -- ");
        if(groupsToDiscover == DiscoveryGroupManagement.ALL_GROUPS) {
            logger.log(Level.FINE, "   ALL_GROUPS");
        } else {
            if(groupsToDiscover.length == 0) {
                logger.log(Level.FINE, "   NO_GROUPS");
            } else {
                for(int i=0;i<groupsToDiscover.length;i++) {
                    logger.log(Level.FINE, "   "
                                      +groupsToDiscover[i]);
                }//end loop
            }//endif
        }//endif
        mainListener.setLookupsToDiscover(initLookupsToStart);
        /* Using either addGroups ore setGroups, re-configure the lookup
         * discovery utility to discover the lookup services started in
         * setup
         */
        if(addGroups) {
            ld.addGroups(groupsToDiscover);
        } else {
            ld.setGroups(groupsToDiscover);
        }//endif
        /* Verify that the listener receives the expected events */
        waitForDiscovery(mainListener);
    }//end run
View Full Code Here

        /* Create LookupDiscovery instance using the new groups */
        logger.log(Level.FINE, "creating a new "
                          +"LookupDiscovery configured to discover -- ");
        GroupsUtil.displayGroupSet(dupGroups,"  group",
                                   Level.FINE);
        LookupDiscovery newLD =
      new LookupDiscovery(dupGroups, getConfig().getConfiguration());
        lookupDiscoveryList.add(newLD);
        /* Verify discovery - set the expected groups to discover */
        mainListener.setLookupsToDiscover(newLookups,dupGroups);
        /* Add the listener to the LookupDiscovery utility */
        newLD.addDiscoveryListener(mainListener);
        /* Wait for the discovery of the expected lookup service(s) */
        waitForDiscovery(mainListener);
    }//end run
View Full Code Here

     *  parent class).
     */
    public void setup(QAConfig sysConfig) throws Exception {
        delayLookupStart = true;//don't start lookups, just want config info
  super.setup(sysConfig);
  newLD = new LookupDiscovery(groupsToDiscover,
            sysConfig.getConfiguration());
  lookupDiscoveryList.add(newLD);
    }//end setup
View Full Code Here

TOP

Related Classes of net.jini.discovery.LookupDiscovery$UnicastDiscoveryTask

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.