Package net.jini.discovery

Examples of net.jini.discovery.LookupDiscovery.addGroups()


    creatorListener = new ServiceCreatorListener();
    destroyListener = new JobDestroyListener();
    ServiceItem si;
    LookupDiscovery discovery = new
      LookupDiscovery(LookupDiscovery.NO_GROUPS);
    discovery.addGroups(spaceGroups);
    ServiceDiscoveryManager serviceDiscoveryManager = new
      ServiceDiscoveryManager(discovery, null);
    si = serviceDiscoveryManager.lookup(spaceTempl, null,
                                        30 * 1000);
    if(si != null && si.service != null) {
View Full Code Here


        /* 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);
View Full Code Here

            /* 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

  ServiceRegistrar reg = createLookup();
  admin = getAdmin(reg);
  String[] actualGroups = new String[] {
      reg.getServiceID().toString() };
  admin.setMemberGroups(actualGroups);
  disc.addGroups(Util.makeGroups("added", 200));
  logger.log(Level.INFO, "increased to " + disc.getGroups().length
       + " elements");
  Thread.sleep(10000);
  disc.removeGroups(Util.makeGroups("start", 300));
  logger.log(Level.INFO,
View Full Code Here

  disc.setGroups(DiscoveryGroupManagement.ALL_GROUPS);
  logger.log(Level.INFO, "set to ALL_GROUPS");
  Thread.sleep(60000);

  try {
      disc.addGroups(actualGroups);
      throw new TestException("addGroups to null didn't throw anything");
  } catch (UnsupportedOperationException e) {
      // expected
  }
View Full Code Here

  disc.setGroups(DiscoveryGroupManagement.NO_GROUPS);
  logger.log(Level.INFO, "set to NO_GROUPS");
  Thread.sleep(10000);
  Discarder arder = new Discarder(reg.getServiceID(), disc);
  disc.addDiscoveryListener(arder);
  disc.addGroups(actualGroups);
  logger.log(Level.INFO, "increased to " + disc.getGroups().length
       + " elements");
  Thread.sleep(30000);

  if (arder.discovery != true) {
View Full Code Here

      throw new TestException( "unexpected event reported");
  }
  disc.terminate();

  try {
      disc.addGroups(actualGroups);
      throw new TestException("addGroups after terminate didn't "
          + "throw anything");
  } catch (IllegalStateException e) {
  }
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.