Package net.jini.lookup

Examples of net.jini.lookup.LookupCache


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

                    LookupCache lookupCache = JiniServiceFactory.serviceDiscoveryManager.createLookupCache(test,
                            null, new Listener(test.serviceTypes));
                    serviceCaches.put(test, lookupCache);

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


        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);

                for (int i = 0; i < services.length; i++) {
                    Debug.printDebugInfo(10,
                        "Discarding Service : " + services[i].service);
                    lookupCache.discard(services[i].service);
                }

                /* Terminating the cache should wait until the internal discardTask Thread
                 * gets the chance to send the events to the Listener. Wait a reasanble time.
                */
                try {
                    Thread.sleep(JiniDriverImpl.WAIT_TIME_MS);
                } catch (InterruptedException ex) {
                }

                lookupCache.terminate();

                Debug.printDebugInfo(10,
                    "LookupCache " + lookupCache + " terminated");
            }
        }
View Full Code Here

                null);

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

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

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

        }
        /* createLookupCache */
        methodStr = new String("createLookupCache()");
        logger.log(Level.FINE, "invoking "+methodStr+" ...");
        try {
            LookupCache cache = srvcDiscoveryMgr.createLookupCache
                                                            (template,
                                                             firstStageFilter,
                                                             null);//listener
            logger.log(Level.FINE, errStr+methodStr);
            failed = true;
View Full Code Here

        }
        /* createLookupCache */
        methodStr = new String("createLookupCache()");
        logger.log(Level.FINE, "invoking "+methodStr+" ...");
        try {
            LookupCache cache = srvcDiscoveryMgr.createLookupCache
                                                            (template,
                                                             firstStageFilter,
                                                             null);//listener
            logger.log(Level.FINE, errStr+methodStr);
            failed = true;
View Full Code Here

        ServiceDiscoveryManager sdm = new ServiceDiscoveryManager(context.getDiscoveryManager(),
                                                                  new LeaseRenewalManager(context.getConfiguration()),
                                                                  context.getConfiguration());
        for(EventDescriptor eventDescriptor : context.getEventDescriptors()) {
            ServiceTemplate template = new ServiceTemplate(null, null, new Entry[]{eventDescriptor});
            LookupCache lCache = sdm.createLookupCache(template, null,  null);
            EventProducerManager eventProducerManager = new EventProducerManager(eventDescriptor, this, lCache);
            lCache.addListener(eventProducerManager);
            eventProducerManagers.add(eventProducerManager);
        }

    }
View Full Code Here

TOP

Related Classes of net.jini.lookup.LookupCache

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.