Package org.apache.felix.dm

Examples of org.apache.felix.dm.FilterIndex


      m_logger = new Logger(context);
    }
    }

    public void addServiceListener(ServiceListener listener, String filter) throws InvalidSyntaxException {
        FilterIndex filterIndex = m_cache.hasFilterIndexFor(null, filter);
        if (filterIndex != null) {
            filterIndex.addServiceListener(listener, filter);
        }
        else {
//            System.out.println("BCI:Listener " + listener.getClass().getName() + " filter " + filter);
            m_context.addServiceListener(listener, filter);
        }
View Full Code Here


            m_context.addServiceListener(listener, filter);
        }
    }

    public void addServiceListener(ServiceListener listener) {
        FilterIndex filterIndex = m_cache.hasFilterIndexFor(null, null);
        if (filterIndex != null) {
            filterIndex.addServiceListener(listener, null);
        }
        else {
//            System.out.println("BCI:Listener " + listener.getClass().getName() + " without filter");
            m_context.addServiceListener(listener);
        }
View Full Code Here

      long start = 0L;
      if (m_perfmon) {
        start = System.currentTimeMillis();
      }
        // first we ask the cache if there is an index for our request (class and filter combination)
        FilterIndex filterIndex = m_cache.hasFilterIndexFor(clazz, filter);
        if (filterIndex != null) {
            List /* <ServiceReference> */ result = filterIndex.getAllServiceReferences(clazz, filter);
            Iterator iterator = result.iterator();
            while (iterator.hasNext()) {
                ServiceReference reference = (ServiceReference) iterator.next();
                String[] list = (String[]) reference.getProperty(Constants.OBJECTCLASS);
                for (int i = 0; i < list.length; i++) {
View Full Code Here

        }
    }

    public ServiceReference[] getAllServiceReferences(String clazz, String filter) throws InvalidSyntaxException {
        // first we ask the cache if there is an index for our request (class and filter combination)
        FilterIndex filterIndex = m_cache.hasFilterIndexFor(clazz, filter);
        if (filterIndex != null) {
            List /* <ServiceReference> */ result = filterIndex.getAllServiceReferences(clazz, filter);
            if (result == null || result.size() == 0) {
                return null;
            }
            return (ServiceReference[]) result.toArray(new ServiceReference[result.size()]);
        }
View Full Code Here

    }

    public FilterIndex hasFilterIndexFor(String clazz, String filter) {
        Iterator iterator = m_filterIndexList.iterator();
        while (iterator.hasNext()) {
            FilterIndex filterIndex = (FilterIndex) iterator.next();
            if (filterIndex.isApplicable(clazz, filter)) {
                return filterIndex;
            }
        }
        return null;
    }
View Full Code Here

    }

    public void serviceChangedForFilterIndices(ServiceEvent event) {
        Iterator iterator = m_filterIndexList.iterator();
        while (iterator.hasNext()) {
            FilterIndex filterIndex = (FilterIndex) iterator.next();
            filterIndex.serviceChanged(event);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.felix.dm.FilterIndex

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.