CustomFilterAdapterConfigurationImpl is listening for all servlet
filters being published to OSGi registry. This unfortunately means
it picks up also filters destined for HTTP Whiteboard -- such as
CustomFilterAdapter, which in turn uses ConfigurationImpl to get
its list of filters -- leading to the filter referencing itself.
Exclude Filters properly marked for HTTP Whiteboard from contributing to
the list and drop a FIXME for a future enhancement.
JIRA: AAA-235
Change-Id: I80c1264889b42a105a62cd5da4238a54554839dd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
// Invoked when a Filter OSGi service is added
@Reference(cardinality = ReferenceCardinality.MULTIPLE,
- policy = ReferencePolicy.DYNAMIC, policyOption = ReferencePolicyOption.GREEDY)
+ policy = ReferencePolicy.DYNAMIC, policyOption = ReferencePolicyOption.GREEDY,
+ // Needed to exclude any filters that is published for HTTP Whiteboard
+ // FIXME: it would be much better if we had a whitelist property to prevent confusion
+ target = "(!(|"
+ + "(osgi.http.whiteboard.filter.pattern=*)"
+ + "(osgi.http.whiteboard.filter.regex=*)"
+ + "(osgi.http.whiteboard.filter.servlet=*)"
+ + "))")
public void addFilter(final Filter filter) {
if (filter == null) {
return;