Search in sources :

Example 6 with ResourceHandler

use of org.apache.felix.dm.ResourceHandler in project felix by apache.

the class ResourceProvider method change.

@SuppressWarnings({ "deprecation", "unchecked" })
public void change(int resourceIndex) {
    Map<ResourceHandler, Filter> handlers = new HashMap<>();
    synchronized (m_handlers) {
        handlers.putAll(m_handlers);
    }
    for (Map.Entry<ResourceHandler, Filter> e : handlers.entrySet()) {
        ResourceHandler handler = e.getKey();
        Filter filter = e.getValue();
        if (filter == null || filter.match((Dictionary<String, ?>) ResourceUtil.createProperties(m_resources[resourceIndex]))) {
            handler.changed(m_resources[resourceIndex]);
        }
    }
}
Also used : Dictionary(java.util.Dictionary) Filter(org.osgi.framework.Filter) HashMap(java.util.HashMap) ResourceHandler(org.apache.felix.dm.ResourceHandler) Map(java.util.Map) HashMap(java.util.HashMap)

Aggregations

HashMap (java.util.HashMap)6 Map (java.util.Map)6 ResourceHandler (org.apache.felix.dm.ResourceHandler)6 Filter (org.osgi.framework.Filter)6 Dictionary (java.util.Dictionary)1