Search in sources :

Example 1 with ResourceHandler

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

the class ResourceProvider method destroy.

public void destroy() {
    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();
        removeResources(handler, filter);
    }
}
Also used : Filter(org.osgi.framework.Filter) HashMap(java.util.HashMap) ResourceHandler(org.apache.felix.dm.ResourceHandler) Map(java.util.Map) HashMap(java.util.HashMap)

Example 2 with ResourceHandler

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

the class ResourceProvider method change.

@SuppressWarnings("deprecation")
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(ResourceUtil.createProperties(m_resources[resourceIndex]))) {
            handler.changed(m_resources[resourceIndex]);
        }
    }
}
Also used : Filter(org.osgi.framework.Filter) HashMap(java.util.HashMap) ResourceHandler(org.apache.felix.dm.ResourceHandler) Map(java.util.Map) HashMap(java.util.HashMap)

Example 3 with ResourceHandler

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

the class ResourceProvider method destroy.

public void destroy() {
    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();
        removeResources(handler, filter);
    }
}
Also used : Filter(org.osgi.framework.Filter) HashMap(java.util.HashMap) ResourceHandler(org.apache.felix.dm.ResourceHandler) Map(java.util.Map) HashMap(java.util.HashMap)

Example 4 with ResourceHandler

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

the class ResourceProvider method change.

@SuppressWarnings("deprecation")
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(ResourceUtil.createProperties(m_resources[resourceIndex]))) {
            handler.changed(m_resources[resourceIndex]);
        }
    }
}
Also used : Filter(org.osgi.framework.Filter) HashMap(java.util.HashMap) ResourceHandler(org.apache.felix.dm.ResourceHandler) Map(java.util.Map) HashMap(java.util.HashMap)

Example 5 with ResourceHandler

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

the class ResourceProvider method destroy.

public void destroy() {
    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();
        removeResources(handler, filter);
    }
}
Also used : 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