Package net.jini.core.lookup

Examples of net.jini.core.lookup.ServiceTemplate


                HashSet toRemoveCaches = new HashSet(serviceCaches.keySet());
                Iterator it = toRemoveCaches.iterator();
                List l = Arrays.asList(template);

                while (it.hasNext()) {
                    ServiceTemplate test = (ServiceTemplate) it.next();

                    if (l.contains(test)) {
                        toRemoveCaches.remove(test);
                    }
                }

                ungetServices(toRemoveCaches);

                // Building list for new needed services
                HashSet toAddCaches = new HashSet(l);
                Iterator it2 = toAddCaches.iterator();
                Set set = serviceCaches.keySet();

                while (it2.hasNext()) {
                    ServiceTemplate test = (ServiceTemplate) it2.next();

                    if (set.contains(test)) {
                        toAddCaches.remove(test);
                    }
                }
View Full Code Here


    void getServices(Set templates) {
        synchronized (this) {
            Iterator it = templates.iterator();

            while (it.hasNext()) {
                ServiceTemplate test = (ServiceTemplate) it.next();

                try {
                    Debug.printDebugInfo(10, "Creating LookupCache");

                    // Needed to spawn in order to find the right classes.
View Full Code Here

    void ungetServices(Set templates) {
        synchronized (this) {
            Iterator it = templates.iterator();

            while (it.hasNext()) {
                ServiceTemplate test = (ServiceTemplate) it.next();
                LookupCache lookupCache = (LookupCache) serviceCaches.remove(test);
                ServiceItem[] services = lookupCache.lookup(null,
                        Integer.MAX_VALUE);
                Debug.printDebugInfo(10,
                    "Services to discard (array object) " + services);
View Full Code Here

        lookupDiscovery = new LookupDiscovery(getLusImportGroups());

        serviceDiscoveryManager = new ServiceDiscoveryManager(lookupDiscovery,
                null);

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

        LookupCache registrarCache = serviceDiscoveryManager.createLookupCache(registrarTemplate,
                null, new Listener(ServiceRegistrar.class));
View Full Code Here

      joiners = new ArrayList();
      leaseList = new Vector();
      creatorListener = new ServiceCreatorListener();
      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;
View Full Code Here

                              Entry[] entry, String clName)
    throws ClassNotFoundException, RemoteException
  {
    super();
    Class [] cls = { Class.forName(clName) };
    lookupCache = clm.createLookupCache(new ServiceTemplate(null,
                                                            cls,
                                                            entry),
                                        null, this);
    //this.key = ((JobUserKey)entry[0]).key;
    //System.out.println("JAM SERVICE UIKey: " + key);
View Full Code Here

  {
    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;
    //System.out.println("JAM SERVICE UIKey: " + key);
  }
View Full Code Here

  {
    try {
      System.setSecurityManager(new SecurityManager());
      Class [] cls =
      { Class.forName("com.sun.grid.jam.queue.QueueInterface") };
      ServiceTemplate tmpl = new ServiceTemplate(null, cls, null);
      String[] groups = { System.getProperty("user.name")};
      JAMJobSubmitter submitter = new JAMJobSubmitter("JAM Job Submission",
                                                      tmpl, groups);
      submitter.pack();
      submitter.setVisible(true);
View Full Code Here

    JAMServiceHandler brw;

    System.setSecurityManager(new SecurityManager());
    Class [] cls =
    { Class.forName("com.sun.grid.jam.app.ApplicationInterface") };
    ServiceTemplate tmpl = new ServiceTemplate(null, cls, null);
    if (args.length >= 1)
      brw = new JAMServiceHandler("JAM Application Browser", tmpl, args[0]);
    else
      brw = new JAMServiceHandler("JAM Application Browser", tmpl, null);
    brw.pack();
View Full Code Here

  /**
   * @see org.springmodules.beans.factory.config.AbstractFactoryBean#createInstance()
   */
  protected Object createInstance() throws Exception {
    ServiceTemplate templ;

    if (template == null) {
      Class[] types = (serviceClass == null ? null : new Class[] { serviceClass });
      Entry[] entry = (serviceName == null ? null : new Entry[] { new Name(serviceName) });

      templ = new ServiceTemplate(null, types, entry);
    }
    else
      templ = template;

    final ServiceTemplate finalTemplate = templ;

    LookupDiscovery lookupDiscovery = null;

    try {
      lookupDiscovery = new LookupDiscovery(groups);
View Full Code Here

TOP

Related Classes of net.jini.core.lookup.ServiceTemplate

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.