Exemplo n.º 1
0
  protected ServiceRegistration<?> createRestrictPortletServletRequestFilter(
      BundleContext bundleContext, String contextName, ClassLoader classLoader) {

    Dictionary<String, Object> properties = new HashMapDictionary<>();

    properties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT, contextName);
    properties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_ASYNC_SUPPORTED, Boolean.TRUE);
    properties.put(
        HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_DISPATCHER,
        new String[] {
          DispatcherType.ASYNC.toString(),
          DispatcherType.FORWARD.toString(),
          DispatcherType.INCLUDE.toString(),
          DispatcherType.REQUEST.toString()
        });
    properties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_PATTERN, "/*");

    return bundleContext.registerService(
        Filter.class, new RestrictPortletServletRequestFilter(), properties);
  }