Package net.jini.core.discovery

Examples of net.jini.core.discovery.LookupLocator


     */
    private void discoverLocators(LookupLocator[] lcts) {
  assert Thread.holdsLock(this);
  discoverLocatorsCalled = true;
  if (lcts == nullreturn;
  LookupLocator lct;
  for(int i=0; i<lcts.length; i++) {
      if(isDiscovered(lcts[i]))  continue;
      LocatorReg reg = findReg(lcts[i]);//in not-yet-discovered map?
      if(reg == null) {
    reg = new LocatorReg(lcts[i]);
View Full Code Here


                        ServiceRegistrar[] regs = e.getRegistrars();
                        logger.finest(eType+" event  -- "+regs.length
                                                         +" lookup(s)");
                        Map groupsMap = e.getGroups();
                        for(int i=0;i<regs.length;i++) {
                            LookupLocator loc = null;
                            try {
                                loc = regs[i].getLocator();
                            } catch (Throwable ex) { /* ignore */ }
                            String[] groups = (String[])groupsMap.get(regs[i]);
                            logger.finest("    "+eType+" locator  = "+loc);
View Full Code Here

      throw new IOException("unsupported protocol version: " + proto);
  String host = ds.readUTF();
  int port = ds.readInt();
  if (port <= 0 || port >= 65536)
      throw new IOException("port number out of range: " + port);
  locator = new LookupLocator(host, port);
  serviceID = new ServiceID(ds);
  int groupCount = ds.readInt();
  // We know that the minimal length of a string written with
  // DataOutput.writeUTF is two bytes (for the empty string), so
  // we make some attempt to see if the count can plausibly fit
View Full Code Here

      "recoveredLookupLocatorPreparer", ProxyPreparer.class,
       defaultPreparer);

    final List prepared = new java.util.LinkedList();
    for (int i=0; i<locators.length; i++) {
        final LookupLocator locator = locators[i];
        try {
      prepared.add(recoveredLookupLocatorPreparer.
             prepareProxy(locator));
        } catch (Throwable t) {
      logger.log(Level.INFO,
View Full Code Here

  synchronized(this) {
            if (terminated) {
                throw new IllegalStateException("discovery terminated");
            }
            if(proxy == null) return;
      LookupLocator lct = findRegFromProxy(proxy);
      if(lct == null) return;
            /* Remove locator from the set of already-discovered locators */
      LocatorReg reg = removeDiscoveredLocator(lct);
            /* Prepare the information for the discarded event */
            HashMap groupsMap = new HashMap(1);
View Full Code Here

        Class<?>[] classes = new Class<?>[] {net.jini.core.transaction.server.TransactionManager.class};
        // Name sn = new Name("*");
        ServiceTemplate tmpl = new ServiceTemplate(null, classes, new Entry[] {});

        // Creating a lookup locator
        LookupLocator locator = new LookupLocator(uri);
        ServiceRegistrar sr = locator.getRegistrar();

        TransactionManager tm = (TransactionManager) sr.lookup(tmpl);
        return tm;
    }
View Full Code Here

        Class<?>[] classes = new Class<?>[] {net.jini.space.JavaSpace.class};
        Name sn = new Name(spaceName);
        ServiceTemplate tmpl = new ServiceTemplate(null/* serviceID */, classes, new Entry[] {sn});

        LookupLocator locator = new LookupLocator(url); // <protocol>://<hostname>
        ServiceRegistrar sr = locator.getRegistrar();
        JavaSpace space = (JavaSpace) sr.lookup(tmpl);

        return space;
    }
View Full Code Here

        Class<?>[] classes = new Class<?>[] {net.jini.space.JavaSpace.class};
        Name sn = new Name(spaceName);
        ServiceTemplate tmpl = new ServiceTemplate(null/* serviceID */, classes, new Entry[] {sn});

        LookupLocator locator = new LookupLocator(url); // <protocol>://<hostname>
        ServiceRegistrar sr = locator.getRegistrar();
        JavaSpace space = (JavaSpace) sr.lookup(tmpl);

        return space;
    }
View Full Code Here

        Class<?>[] classes = new Class<?>[] {net.jini.core.transaction.server.TransactionManager.class};
        // Name sn = new Name("*");
        ServiceTemplate tmpl = new ServiceTemplate(null, classes, new Entry[] {});

        // Creating a lookup locator
        LookupLocator locator = new LookupLocator(uri);
        ServiceRegistrar sr = locator.getRegistrar();

        TransactionManager tm = (TransactionManager) sr.lookup(tmpl);
        return tm;
    }
View Full Code Here

            throws IOException, ClassNotFoundException, InterruptedException {

        // find/wait for lookup _service
        final long startTime = System.currentTimeMillis();
        ServiceRegistrar serviceRegistrar = null;
        final LookupLocator lookup = new LookupLocator(JINI_URL_LOCALHOST);
        while (serviceRegistrar == null
                && (System.currentTimeMillis() - startTime < (retryTimeoutSecs * 1000))) {

            try {
                serviceRegistrar = lookup.getRegistrar();
            } catch (ConnectException e) {
                Thread.sleep(500);
            } catch (SocketException e) {
                Thread.sleep(500);
            } catch (EOFException e) {
View Full Code Here

TOP

Related Classes of net.jini.core.discovery.LookupLocator

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.