Package net.jini.core.lookup

Examples of net.jini.core.lookup.ServiceMatches


     * created during setup. Verifies that every simple lookup returns
     * a null object; and every match lookup returns zero matches.
     */
    private void doLookupNoMatch() throws TestException, RemoteException {
        Object serviceObj = null;
        ServiceMatches matches = null;
        for (int i=0; i<srvcIDTmpls.length; i++) {
      if(proxy.lookup(srvcIDTmpls[i]) != null) {
    throw new TestException("srvcIDTmpls["+i+"] != null");
      }
      matches = proxy.lookup(srvcIDTmpls[i],Integer.MAX_VALUE);
View Full Code Here


           tmpl4, tmpl5},
           new Entry[]{mod0, mod1,
           mod2, mod3,
           mod4, mod5});
  ServiceTemplate t = new ServiceTemplate(reg.getServiceID(), null, null);
  ServiceMatches matches = getProxy().lookup(t, 1);
  if (matches.items.length != 1)
      throw new TestException("wrong number of matches from lookup");
  Entry[] newAttrs = matches.items[0].attributeSets;
  java.util.List list = java.util.Arrays.asList(newAttrs);
  for (int i = 0; i < attrs.length; i++) {
View Full Code Here

     *  Performs a match lookup using the template created during setup and
     *  zero maximum matches. Verifies that the expected number of services
     *  are returned by the call to lookup().
     */
    public void run() throws Exception {
  ServiceMatches matches = null;
  matches = proxy.lookup(tmpl,0);
  if (matches.totalMatches != expectedNMatches) {
      throw new TestException
                ("totalMatches ("+matches.totalMatches+
                 ") != expectedNMatches ("+expectedNMatches+")");
View Full Code Here

  } catch (Throwable t) {
    logger.log(Level.INFO, "obtaining attributes failed", t);
  }
      } else {
  try{
    ServiceMatches matches = registrar.lookup(stmpl, 1);
    if(matches.totalMatches != 1)
      Browser.logger.log(Level.INFO, "unexpected lookup matches: {0}",
             new Integer(matches.totalMatches));
    else
      item.attributeSets = matches.items[0].attributeSets;
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}",
View Full Code Here

  for(int i=0; i<len; i++) {
      ServiceRegistrar proxy = proxys[(i + rand) % len];
      ServiceItem sItem = null;
      try {
                int maxMatches = ( (filter != null) ? Integer.MAX_VALUE : 1 );
    ServiceMatches sm = proxy.lookup(tmpl, maxMatches);
    sItem = getMatchedServiceItem(sm, filter);
      } catch(Exception e) {
                logger.log(Level.INFO,
                           "Exception occurred during query, discarding proxy",
                           e);
View Full Code Here

                     * 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

    _registrars.remove(reg.getServiceID());
  }
   
  private synchronized void findServices(ServiceRegistrar reg) {
    try {
      ServiceMatches matches = reg.lookup(_serviceTemplate, Integer.MAX_VALUE);
      System.out.println(matches.totalMatches + " services found " + reg);
      if (matches.totalMatches == 0)
  matches = reg.lookup(_serviceTemplate, Integer.MAX_VALUE);
 
      for (int i = 0; i < matches.totalMatches; i++) {
View Full Code Here

  _registrars.remove(reg.getServiceID());
    }
   
    private synchronized void findServices(ServiceRegistrar reg) {
  try {
      ServiceMatches matches = reg.lookup(_serviceTemplate,
            Integer.MAX_VALUE);
      System.out.println(matches.totalMatches + " services found " + reg);
      if (matches.totalMatches == 0)
    matches = reg.lookup(_serviceTemplate, Integer.MAX_VALUE);
 
View Full Code Here

    this.eReg = eReg;
      }
            public void run() {
                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;
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.