Package net.jini.core.lookup

Examples of net.jini.core.lookup.ServiceRegistrar.lookup()


                     * requested by passing in "infinity" for the maximum
                     * number of matches (Integer.MAX_VALUE).
                     */
                    if(filter != null) max = Integer.MAX_VALUE;
                    /* Query the current lookup for matching service(s). */
        ServiceMatches sm = proxy.lookup(tmpl, max);
        int nItems = sm.items.length;
        if(nItems == 0) continue;//no matches, query next lookup
                    /* Loop thru the matching services, randomly selecting
                     * each service, applying the filter if appropriate,
                     * and making sure the service has not already been
View Full Code Here


                logger.finest("ServiceDiscoveryManager - LookupTask started");
    ServiceRegistrar proxy = reg.proxy;
    ServiceMatches matches;
                /* For the given lookup, get all services matching the tmpl */
    try {
        matches = proxy.lookup(tmpl, Integer.MAX_VALUE);
    } catch (Exception e) {
                    boolean cacheTerminated;
                    synchronized(serviceIdMap) {
      eReg.lookupsPending--;
                        cacheTerminated = bCacheTerminated;
View Full Code Here

       +"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

        while(deltaT < maxT) {
            for(int i=0;i<lusList.size();i++) {
                ServiceRegistrar reg = (ServiceRegistrar)lusList.get(i);
                if(regList.contains(reg)) continue;
                try {
                    Object testService = reg.lookup(template);
                    if(testService instanceof TestService) {
                        regList.add(reg);
                    }//endif
                } catch(RemoteException e) { /* try again*/ }
            }//end loop
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) {
View Full Code Here

                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

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.