} else if ( modeString.equalsIgnoreCase("if-unused") ) {
mode = AuthenticationConstants.LOGOUT_MODE_IF_UNUSED;
} else if ( modeString.equalsIgnoreCase("immediately") ) {
mode = AuthenticationConstants.LOGOUT_MODE_IMMEDIATELY;
} else {
throw new ProcessingException("Unknown mode " + modeString);
}
// logout
AuthenticationManager authManager = null;
try {
authManager = (AuthenticationManager) this.manager.lookup(AuthenticationManager.ROLE);
final String handlerName = par.getParameter("handler",
authManager.getHandlerName());
if ( null == handlerName )
throw new ProcessingException("LogoutAction requires at least the handler parameter.");
authManager.logout( handlerName , mode );
} finally {
this.manager.release( authManager );
}