Browse Source

Added constructor injection options to ConcurrentSessionFilter

Luke Taylor 14 years ago
parent
commit
8740efc0f5

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

@@ -64,6 +64,22 @@ public class ConcurrentSessionFilter extends GenericFilterBean {
 
 
     //~ Methods ========================================================================================================
     //~ 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
     @Override
     public void afterPropertiesSet() {
     public void afterPropertiesSet() {
         Assert.notNull(sessionRegistry, "SessionRegistry required");
         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) {
     public void setExpiredUrl(String expiredUrl) {
         this.expiredUrl = expiredUrl;
         this.expiredUrl = expiredUrl;
     }
     }
 
 
+    /**
+     * @deprecated use constructor injection instead
+     */
+    @Deprecated
     public void setSessionRegistry(SessionRegistry sessionRegistry) {
     public void setSessionRegistry(SessionRegistry sessionRegistry) {
         this.sessionRegistry = sessionRegistry;
         this.sessionRegistry = sessionRegistry;
     }
     }