org.apache.felix.eventadmin.impl.handler
Class CacheFilters

java.lang.Object
  extended by org.apache.felix.eventadmin.impl.handler.CacheFilters
All Implemented Interfaces:
Filters

public class CacheFilters
extends java.lang.Object
implements Filters

This is an implementation of the Filters factory that uses a cache in order to speed-up filter creation.

Author:
Felix Project Team

Field Summary
 
Fields inherited from interface org.apache.felix.eventadmin.impl.handler.Filters
FALSE_FILTER, TRUE_FILTER
 
Constructor Summary
CacheFilters(CacheMap cache, org.osgi.framework.BundleContext context)
          The constructor of this factory.
 
Method Summary
 org.osgi.framework.Filter createFilter(java.lang.String filter, org.osgi.framework.Filter nullFilter)
          Create a filter for the given filter string or return the nullFilter in case the string is null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheFilters

public CacheFilters(CacheMap cache,
                    org.osgi.framework.BundleContext context)
The constructor of this factory. The cache is used to speed-up filter creation.

Parameters:
cache - The cache to use
context - The context of the bundle used to create the Filter objects
Method Detail

createFilter

public org.osgi.framework.Filter createFilter(java.lang.String filter,
                                              org.osgi.framework.Filter nullFilter)
                                       throws org.osgi.framework.InvalidSyntaxException
Create a filter for the given filter string or return the nullFilter in case the string is null.

Specified by:
createFilter in interface Filters
Parameters:
filter - The filter as a string
nullFilter - The default value to return if filter is null
Returns:
The Filter of the filter string or the nullFilter if the filter string was null
Throws:
org.osgi.framework.InvalidSyntaxException - if BundleContext.createFilter() throws an InvalidSyntaxException
See Also:
Filters.createFilter(java.lang.String, org.osgi.framework.Filter)