Package net.jini.lookup

Examples of net.jini.lookup.ServiceDiscoveryManager


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

        lookupDiscovery = new LookupDiscovery(getLusImportGroups());

        serviceDiscoveryManager = new ServiceDiscoveryManager(lookupDiscovery,
                null);

        ServiceTemplate registrarTemplate = new ServiceTemplate(null,
                new Class[] { ServiceRegistrar.class }, null);
View Full Code Here


      destroyListener = new JobDestroyListener();
      ServiceItem si;
      ServiceTemplate st;
      LookupDiscoveryManager discovery = new
        LookupDiscoveryManager(spaceGroups, locators, null);
      ServiceDiscoveryManager serviceDiscoveryManager = new
        ServiceDiscoveryManager(discovery, null);
      System.out.print("...");
      st = new ServiceTemplate(null, spaceClss, spaceEntries);
      si = serviceDiscoveryManager.lookup(st, null,
                                          10 * 1000);
      if(si != null && si.service != null) {
        space = (JavaSpace) si.service;
        si = null;
        System.out.print("...");
      } else {
        throw
          new RMServerException("JobRepository not found");
      }
      discovery.setGroups(txnGroups);
      st = new ServiceTemplate(txnID, txnClss, txnEntries);
      si = serviceDiscoveryManager.lookup(st, null,
                                          10 * 1000);
      if(si != null && si.service != null) {
        txnMgr = (TransactionManager) si.service;
        si = null;
        System.out.print("...");
      } else {
        throw
          new RMServerException("TransactionManager not found");
      }
      discovery.terminate();
      serviceDiscoveryManager.terminate();
      System.out.println(" ready.");
    } catch(Exception e) {
      throw new RMServerException(e.getMessage());
    }
  }
View Full Code Here

    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

  public JAMServiceUILauncher(String[] groups, LookupLocator[] locators,
                              Entry[] entry, String clName)
    throws ClassNotFoundException, IOException
  {
    super();
    clm = new ServiceDiscoveryManager(new
      LookupDiscoveryManager(groups, locators, null), null);
    Class [] cls = { Class.forName(clName) };
    lookupCache = clm.createLookupCache(new
      ServiceTemplate(null, cls, entry), null, this);
    //this.key = ((JobUserKey)entry[0]).key;
View Full Code Here

                         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

  mainListener = new LookupListener();
  mainListener.setLookupsToDiscover(initLookupsToStart);
  if(createSDMInSetup) {
      /* Construct the ServiceDiscoveryManager that will be tested */
      logger.log(Level.FINE, "constructing a service discovery manager");
      srvcDiscoveryMgr = new ServiceDiscoveryManager
    (getLookupDiscoveryManager(),
     null,  //LeaseRenewalManager
     sysConfig.getConfiguration());
      sdmList.add(srvcDiscoveryMgr);
  }//endif
View Full Code Here

        try {
           /* Terminate each service discovery manager and each discovery
            * manager created during the test run.
            */
            for(int i=0;i<sdmList.size();i++) {
                ServiceDiscoveryManager sdmMgr
                                    = (ServiceDiscoveryManager)sdmList.get(i);
                DiscoveryManagement discMgr = sdmMgr.getDiscoveryManager();
                try {
                    logger.log(Level.FINE,
       "tearDown - terminating service discovery manager "+i);
                    sdmMgr.terminate();
                } catch(Exception e) {
                    e.printStackTrace();
                }
                try {
                    logger.log(Level.FINE,
View Full Code Here

      new LookupDiscoveryManager(DiscoveryGroupManagement.NO_GROUPS,
               null,
               null,
               sysConfig.getConfiguration());
        srvcDiscoveryMgr =
      new ServiceDiscoveryManager(discoveryMgr,
          null,
          sysConfig.getConfiguration());
        sdmList.add(srvcDiscoveryMgr);
    }//end setup
View Full Code Here

        int nAttrs   = 0;
        registerServices(startVal, nSrvcs, nAttrs, testServiceType);

        /* 2. Create half the SDM's and caches */
        for (int i=0; i<(N_SDM/2); i++) {
            ServiceDiscoveryManager sdm = new ServiceDiscoveryManager
                                      (ldm,null,testConfig.getConfiguration());
            sdmList.add(sdm);
            SDMListener l = new SDMListener(testConfig, "SDM_"+i);
            sdmListeners.add(l);
            caches.add( sdm.createLookupCache(template, null, l) );
        }//end loop

        /* 3. Register the remaining services */
        startVal = nSrvcs;
        registerServices(startVal, nSrvcs, nAttrs, testServiceType);

        /* 4. Create the remaining SDM's and caches */
        for (int i=(N_SDM/2); i<N_SDM; i++) {
            ServiceDiscoveryManager sdm = new ServiceDiscoveryManager
                                      (ldm,null,testConfig.getConfiguration());
            sdmList.add(sdm);
            SDMListener l = new SDMListener(testConfig, "SDM_"+i);
            sdmListeners.add(l);
            caches.add( sdm.createLookupCache(template, null, l) );
        }//end loop

        /* 5. Allow serviceAdded and serviceRemoved event to arrive */
        int nSecsTotal = 0;
        int nSecsWait  = 5;
View Full Code Here

        terminateDelay = 0;
        super.setup(config);
        testDesc = "service discovery manager with default lookup "
                   +"discovery manager (should discover public lookups)";
        srvcDiscoveryMgr =
      new ServiceDiscoveryManager(null,
          null,
          config.getConfiguration());
        sdmList.add(srvcDiscoveryMgr);
    }//end setup
View Full Code Here

TOP

Related Classes of net.jini.lookup.ServiceDiscoveryManager

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.