class SecurityDelegatingHttpContext implements HttpContext {

    @Override
    @SuppressWarnings({
     "unchecked", "rawtypes"
    })
    public boolean handleSecurity(HttpServletRequest request, HttpServletResponse response) throws IOException {
        ServiceReference[] refs;
        try {
            refs = bundleContext.getServiceReferences(Filter.class.getName(), FILTER_FILTER);
        } catch (InvalidSyntaxException e) {
            LOG.warn(e.getMessage(), e);
            return false;
        }
        if (refs == null || refs.length == 0) {
            LOG.info("No filter registered.");
            return !requireFilter;
        }
        Filter[] filters = new Filter[refs.length];
        try {
            for (int i = 0; i < refs.length; i++) {
                filters[i] = (Filter)bundleContext.getService(refs[i]);
            }
            try {
                new Chain(filters).doFilter(request, response);
                return !response.isCommitted();
            } catch (ServletException e) {
                LOG.warn(e.getMessage(), e);
                return false;
            }
        } finally {
            for (int i = 0; i < refs.length; i++) {
                if (filters[i] != null) {
                    bundleContext.ungetService(refs[i]);
                }
            }
        }
    }

      SecurityDelegatingHttpContext(BundleContext bundleContext, HttpContext delegate);

}