Publish AAAShiroFilter as a proper Filter service
[aaa.git] / aaa-shiro / impl / src / main / java / org / opendaylight / aaa / shiro / filters / AAAShiroFilter.java
index 0045a2ddccdd22dea09828929383c33601e50474..8eb825a04947a173af754a90bc773a8bd64b573d 100644 (file)
@@ -8,7 +8,13 @@
 
 package org.opendaylight.aaa.shiro.filters;
 
+import javax.servlet.Filter;
 import org.apache.shiro.web.servlet.ShiroFilter;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.ServiceScope;
+import org.osgi.service.http.whiteboard.propertytypes.HttpWhiteboardFilterAsyncSupported;
+import org.osgi.service.http.whiteboard.propertytypes.HttpWhiteboardFilterName;
+import org.osgi.service.http.whiteboard.propertytypes.HttpWhiteboardFilterPattern;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -25,11 +31,15 @@ import org.slf4j.LoggerFactory;
  *
  * <code>log:set DEBUG AAAShiroFilter</code>
  *
- * @see <code>javax.servlet.Filter</code>
- * @see <code>org.apache.shiro.web.servlet.ShiroFilter</code>
+ * @see javax.servlet.Filter
+ * @see ShiroFilter
  */
-public class AAAShiroFilter extends ShiroFilter {
-
+// FIXME: @WebFilter?
+@HttpWhiteboardFilterAsyncSupported
+@HttpWhiteboardFilterPattern("/*")
+@HttpWhiteboardFilterName("AAAShiroFilter")
+@Component(service = Filter.class, scope = ServiceScope.PROTOTYPE)
+public final class AAAShiroFilter extends ShiroFilter {
     private static final Logger LOG = LoggerFactory.getLogger(AAAShiroFilter.class);
 
     public AAAShiroFilter() {
@@ -41,11 +51,11 @@ public class AAAShiroFilter extends ShiroFilter {
      *
      * Adds context clues that aid in debugging.
      *
-     * @see org.apache.shiro.web.servlet.ShiroFilter#init()
+     * @see ShiroFilter#init()
      */
     @Override
     public void init() throws Exception {
         super.init();
-        LOG.debug("Initializing the AAAShiroFilter");
+        LOG.debug("AAAShiroFilter initialized");
     }
 }