Package net.jini.core.lookup

Examples of net.jini.core.lookup.ServiceMatches


       +"to verify all service registrations ...");
  ArrayList lusList = getLookupListSnapshot
      ("impl.joinmanager.RegisterStorm");
  ServiceRegistrar reg = (ServiceRegistrar)lusList.get(0);
  /* Verify nServices registered with lookup service 0 */
  ServiceMatches matches = reg.lookup(template,
              Integer.MAX_VALUE);
  int nRegServices = matches.totalMatches;
  logger.log(Level.FINE, "# of services expected   = " + nServices);
  logger.log(Level.FINE, "# of services registered = " + nRegServices);
  if(nServices != nRegServices) {
View Full Code Here


                                              ("AbstractBaseTest.verifyJoin");
        ArrayList srvcIDs = new ArrayList(lusList.size());
        for(int i=0;i<lusList.size();i++) {
            ServiceRegistrar reg = (ServiceRegistrar)lusList.get(i);
      /* Verify 1 service registered with lookup service i */
      ServiceMatches matches = reg.lookup(template,
            Integer.MAX_VALUE);
      if(matches.totalMatches == 0) {
    throw new TestException("lookup service "+i
                                        +" -- no matching service found");
      } else if(matches.totalMatches != 1) {
View Full Code Here

                int nRegs = regList.size();
                for(int i=0;i<nRegs;i++) {
                    /* Pop the stack of lookups */
                    ServiceRegistrar reg = (ServiceRegistrar)regList.remove(0);
        /* Verify 1 service registered with lookup service i */
        ServiceMatches matches = reg.lookup(template,
              Integer.MAX_VALUE);
        if(matches.totalMatches == 0) {
      throw new TestException("lookup service "+i
               +" -- no matching service found");
        } else if(matches.totalMatches != 1) {
      throw new TestException("lookup service "+i
            +" -- totalMatches ("
            +matches.totalMatches
            +") != 1");
        }//endif
        /* Verify that the given attributes were propagated */
        Entry[] lookupAttrs = matches.items[0].attributeSets;
        logger.log(Level.FINE, "lookup service "+i
             +" -- comparing attributes");
        if(!AttributesUtil.compareAttributeSets(attrs,
                  lookupAttrs,
                  Level.OFF))
                        {
                            logger.log(Level.FINE,
               "                 -- NO MATCH");
                            regList.add(reg);// push it back on the stack
                        } else {
                            logger.log(Level.FINE,
               "                 -- attributes MATCH");
                        }//endif
                 }//end loop
                if(regList.size() == 0) break;
                DiscoveryServiceUtil.delayMS(1000);
                deltaT = System.currentTimeMillis() - T0;
            }//end loop
            /* If propagation failed, display expected & actual attributes */
            if(regList.size() > 0) {
                String retStr = "attributes not propagated successfully "
                                   +"on "+regList.size()+" lookup service(s)";
                logger.log(Level.FINE, retStr);
                AttributesUtil.displayAttributeSet(attrs,
                                                   "expectedAttrs",
                                                   Level.FINE);
                for(int i=0;i<regList.size();i++) {
                    ServiceRegistrar reg = (ServiceRegistrar)regList.get(i);
        ServiceMatches matches = reg.lookup(template,
              Integer.MAX_VALUE);
        if(matches.totalMatches != 1) {
      logger.log(Level.FINE,
           "lookup service "+i+" -- totalMatches "
           +"invalid ("+matches.totalMatches+") ... "
View Full Code Here

    private void wireUpProvisionMonitorEventListener(final Object o) throws Exception {
        Service s = (Service)o;
        ServiceAdmin sAdmin = (ServiceAdmin) s.getAdmin();
        ServiceItem items[] = null;
        for(ServiceRegistrar sr : sAdmin.getJoinSet()) {
            ServiceMatches sm = sr.lookup(new ServiceTemplate(null, new Class[]{ProvisionMonitor.class}, null),
                                          Integer.MAX_VALUE);
            if(sm.items!=null && sm.items.length>0) {
                items = sm.items;
                break;
            }
View Full Code Here

            refreshPanel();
        }

        protected Entry[] getEntryArray() {
            try {
                ServiceMatches matches = registrar.lookup(new ServiceTemplate(item.serviceID,
                                                                              new Class[]{item.service.getClass()},
                                                                              new Entry[]{}),
                                                          10);
                if (matches.totalMatches != 1)
                    Browser.logger.log(Level.INFO, "unexpected lookup matches: {0}", matches.totalMatches);
View Full Code Here

TOP

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

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.