Examples of LookupDiscovery


Examples of net.jini.discovery.LookupDiscovery

        Thread curThread = Thread.currentThread();
        ClassLoader oldClassLoader = curThread.getContextClassLoader();
        curThread.setContextClassLoader(Activator.class.getClassLoader());

        // creating a lookupDiscovery
        lookupDiscovery = new LookupDiscovery(getLusExportGroups());
        joinManager = new JoinManager(this.service, this.entries, this,
                lookupDiscovery, leaseRenewalManager);

        curThread.setContextClassLoader(oldClassLoader);
        oldClassLoader = null;
View Full Code Here

Examples of net.jini.discovery.LookupDiscovery

        // Needed to spawn in order to find the right classes.
        Thread curThread = Thread.currentThread();
        ClassLoader oldClassLoader = curThread.getContextClassLoader();
        curThread.setContextClassLoader(Activator.class.getClassLoader());

        lookupDiscovery = new LookupDiscovery(getLusImportGroups());

        serviceDiscoveryManager = new ServiceDiscoveryManager(lookupDiscovery,
                null);

        ServiceTemplate registrarTemplate = new ServiceTemplate(null,
View Full Code Here

Examples of net.jini.discovery.LookupDiscovery

    joiners = new ArrayList();
    leaseList = new Vector();
    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) {
      space = (JavaSpace) si.service;
      si = null;
      System.out.println("JobRepository found");
    } else {
      System.out.println("Can't find JobRepository");
    }
    discovery.setGroups(txnGroups);
    si = serviceDiscoveryManager.lookup(spaceTempl, null,
                                        30 * 1000);
    if(si != null && si.service != null) {
      txnMgr = (TransactionManager) si.service;
      si = null;
      System.out.println("TransactionManager found");
    } else {
      System.out.println("Can't find TransactionManager");
    }
    discovery.terminate();
    serviceDiscoveryManager.terminate();
  }
View Full Code Here

Examples of net.jini.discovery.LookupDiscovery

                         String[] groups)
    throws IOException
  {
    super(title);
    this.template = template;
    lookupManager = new ServiceDiscoveryManager(new
                                            LookupDiscovery(groups),
                                            null);
    lookupCache = lookupManager.createLookupCache(template, null,
                                                 this);
    browse = new JButton("Browse");
View Full Code Here

Examples of net.jini.discovery.LookupDiscovery

    else
      templ = template;

    final ServiceTemplate finalTemplate = templ;

    LookupDiscovery lookupDiscovery = null;

    try {
      lookupDiscovery = new LookupDiscovery(groups);

      // hook listener for finding the service
      lookupDiscovery.addDiscoveryListener(new DiscoveryListener() {
        public void discovered(DiscoveryEvent ev) {
          log.debug("received discovery event " + ev);
          ServiceRegistrar[] reg = ev.getRegistrars();
          // once the proxy if found, bail out
          for (int i = 0; i < reg.length && proxy == null; i++) {
            findService(finalTemplate, reg[i]);
          }
        }

        public void discarded(DiscoveryEvent ev) {
        }
      });

      if (log.isDebugEnabled())
        log.debug("Awaiting discovery event...");

      if (proxy == null) {
        synchronized (this) {
          this.wait(timeout);
        }
      }

      if (log.isDebugEnabled())
        log.debug("Terminating discovery service");

    }
    catch (IOException e) {
      throw new RemoteLookupFailureException("cannot create lookup discovery", e);
    }
    catch (InterruptedException e) {
      throw new NestedRuntimeException("lookup interrupted", e) {
      };
    }
    finally {
      // make sure to close the lookup threads
      if (lookupDiscovery != null)
        lookupDiscovery.terminate();
    }

    return proxy;
  }
View Full Code Here

Examples of net.jini.discovery.LookupDiscovery

      LookupLocatorDiscovery disco =
    new LookupLocatorDiscovery(locArray);
      disco.addDiscoveryListener(new Discoverer());
  }
  else {
      LookupDiscovery disco = new LookupDiscovery(_groups);
      disco.addDiscoveryListener(new Discoverer());
  }
    }
View Full Code Here

Examples of net.jini.discovery.LookupDiscovery

  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

Examples of net.jini.discovery.LookupDiscovery

  /* Use LookupLocatorDiscovery to find a Lookup Service */
  if (_lookupSrvc == null) { // first time
      // Use LookupDiscovery to find a Lookup Service
      try {
    System.out.println("LookupDiscovery for " + _groupsToJoin[0]);
    _lookupDiscovery = new LookupDiscovery(_groupsToJoin);
      }
      catch (IOException e) {
    System.out.println("IOException from LookupDiscovery constructor");
      }
      _lookupDiscovery
View Full Code Here

Examples of net.jini.discovery.LookupDiscovery

  /* Use LookupLocatorDiscovery to find a Lookup Service */
  if (_lookupSrvc == null) { // first time
      // Use LookupDiscovery to find a Lookup Service
      try {
    System.out.println("LookupDiscovery for " + _groupsToJoin[0]);
    _lookupDiscovery = new LookupDiscovery(_groupsToJoin);
      }
      catch (IOException e) {
    System.out.println("IOException from LookupDiscovery constructor");
      }
      _lookupDiscovery
View Full Code Here

Examples of net.jini.discovery.LookupDiscovery

      LookupLocator[] locArray = new LookupLocator[] { loc };
      LookupLocatorDiscovery disco = new LookupLocatorDiscovery(locArray);
      disco.addDiscoveryListener(new Discoverer());
    }
    else {
      LookupDiscovery disco = new LookupDiscovery(_groups);
      disco.addDiscoveryListener(new Discoverer());
    }
  }
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.