瀏覽代碼

Added constructor injection options to ConcurrentSessionFilter

Luke Taylor 14 年之前
父節點
當前提交
8740efc0f5
共有 1 個文件被更改,包括 24 次插入0 次删除
  1. 24 0
      web/src/main/java/org/springframework/security/web/session/ConcurrentSessionFilter.java

+ 24 - 0
web/src/main/java/org/springframework/security/web/session/ConcurrentSessionFilter.java

@@ -64,6 +64,22 @@ public class ConcurrentSessionFilter extends GenericFilterBean {
 
     //~ Methods ========================================================================================================
 
+
+    /**
+     * @deprecated Use constructor which injects the <tt>SessionRegistry</tt>.
+     */
+    public ConcurrentSessionFilter() {
+    }
+
+    public ConcurrentSessionFilter(SessionRegistry sessionRegistry) {
+        this(sessionRegistry, null);
+    }
+
+    public ConcurrentSessionFilter(SessionRegistry sessionRegistry, String expiredUrl) {
+        this.sessionRegistry = sessionRegistry;
+        this.expiredUrl = expiredUrl;
+    }
+
     @Override
     public void afterPropertiesSet() {
         Assert.notNull(sessionRegistry, "SessionRegistry required");
@@ -121,10 +137,18 @@ public class ConcurrentSessionFilter extends GenericFilterBean {
         }
     }
 
+    /**
+     * @deprecated use constructor injection instead
+     */
+    @Deprecated
     public void setExpiredUrl(String expiredUrl) {
         this.expiredUrl = expiredUrl;
     }
 
+    /**
+     * @deprecated use constructor injection instead
+     */
+    @Deprecated
     public void setSessionRegistry(SessionRegistry sessionRegistry) {
         this.sessionRegistry = sessionRegistry;
     }