HandlerConfiguration config = this.getHandlerConfiguration( handlerName );
if ( config == null ) {
throw new ProcessingException("Unknown handler to logout: " + handlerName);
}
// are we logged in?
UserHandler handler = this.getUserHandler( handlerName );
// we don't throw an exception if we are already logged out!
if ( handler != null ) {
// Do we save something on logout?
/*
if ( config.saveOnLogout()
&& config.getSaveResource() != null) {
final AuthenticationContext authContext = handler.getContext();
try {
// This might not work, because of the missing state
authContext.saveXML("/authentication",
null,
ContextHelper.getObjectModel(this.context),
this.resolver, this.manager);
} catch (Exception ignore) {
// we don't want to stop the logout process
// because of errors during save
this.getLogger().error("Exception while saving authentication information.", ignore);
}
}
// save applications (if configured)
Iterator iter = config.getApplications().values().iterator();
while ( iter.hasNext() ) {
ApplicationConfiguration appConfig = (ApplicationConfiguration) iter.next();
if ( appConfig.saveOnLogout()
&& appConfig.getSaveResource() != null ) {
// ???
}
}
*/
// notify the authenticator
try {
this.lookupAuthenticator(config).logout(handler);
} catch (Exception ignore) {
// we really ignore any exception!
}
List applicationContexts = handler.getApplicationContexts();
if ( applicationContexts != null ) {
ContextManager contextManager = null;
try {
contextManager = (ContextManager)this.manager.lookup(ContextManager.ROLE);