Reformatted LogoutFilter.

This commit is contained in:
Luke Taylor 2007-08-27 16:56:33 +00:00
parent f8689b18b2
commit 82599a72ba
1 changed files with 105 additions and 115 deletions

View File

@ -35,40 +35,33 @@ import org.springframework.util.Assert;
/**
* Logs a principal out.
* <p>
* Polls a series of {@link LogoutHandler}s. The handlers should be specified
* in the order they are required. Generally you will want to call logout
* handlers <code>TokenBasedRememberMeServices</code> and
* Polls a series of {@link LogoutHandler}s. The handlers should be specified in the order they are required.
* Generally you will want to call logout handlers <code>TokenBasedRememberMeServices</code> and
* <code>SecurityContextLogoutHandler</code> (in that order).
* </p>
* <p>
* After logout, the URL specified by {@link #logoutSuccessUrl} will be shown.
* </p>
* <p>
* <b>Do not use this class directly.</b> Instead configure
* <code>web.xml</code> to use the {@link
* org.acegisecurity.util.FilterToBeanProxy}.
* <b>Do not use this class directly.</b> Instead configure <code>web.xml</code> to use the
* {@link org.acegisecurity.util.FilterToBeanProxy}.
* </p>
*
* @author Ben Alex
* @version $Id$
*/
public class LogoutFilter implements Filter {
// ~ Static fields/initializers
// =====================================================================================
//~ Static fields/initializers =====================================================================================
private static final Log logger = LogFactory.getLog(LogoutFilter.class);
// ~ Instance fields
// ================================================================================================
//~ Instance fields ================================================================================================
private String filterProcessesUrl = "/j_acegi_logout";
private String logoutSuccessUrl;
private LogoutHandler[] handlers;
// ~ Constructors
// ===================================================================================================
//~ Constructors ===================================================================================================
public LogoutFilter(String logoutSuccessUrl, LogoutHandler[] handlers) {
Assert.hasText(logoutSuccessUrl, "LogoutSuccessUrl required");
@ -77,8 +70,7 @@ public class LogoutFilter implements Filter {
this.handlers = handlers;
}
// ~ Methods
// ========================================================================================================
//~ Methods ========================================================================================================
/**
* Not used. Use IoC container lifecycle methods instead.
@ -129,13 +121,12 @@ public class LogoutFilter implements Filter {
}
/**
* Allow subclasses to modify when a logout should tak eplace.
* Allow subclasses to modify when a logout should take place.
*
* @param request the request
* @param response the response
*
* @return <code>true</code> if logout should occur, <code>false</code>
* otherwise
* @return <code>true</code> if logout should occur, <code>false</code> otherwise
*/
protected boolean requiresLogout(HttpServletRequest request, HttpServletResponse response) {
String uri = request.getRequestURI();
@ -175,5 +166,4 @@ public class LogoutFilter implements Filter {
Assert.hasText(filterProcessesUrl, "FilterProcessesUrl required");
this.filterProcessesUrl = filterProcessesUrl;
}
}