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 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
TRUE_FILTER
 
Constructor Summary
CacheFilters(CacheMap cache, BundleContext context)
          The constructor of this factory.
 
Method Summary
 Filter createFilter(String filter)
          Create a filter for the given filter string or return the TRUE_FILTER 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,
                    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 Filter createFilter(String filter)
                    throws InvalidSyntaxException
Create a filter for the given filter string or return the TRUE_FILTER in case the string is null.

Specified by:
createFilter in interface Filters
Parameters:
filter - The filter as a string
Returns:
The Filter of the filter string or the TRUE_FILTER if the filter string was null
Throws:
InvalidSyntaxException - if BundleContext.createFilter() throws an InvalidSyntaxException
See Also:
Filters.createFilter(java.lang.String)


Copyright © 2011 Apache Software Foundation. All Rights Reserved.