+ protected void logout() {
+ final CmsSession cmsSession = (CmsSession) getDisplay().getData(
+ CmsSession.KEY);
+ Subject subject = cmsSession.getSubject();
+ try {
+ //
+ // LOGOUT
+ //
+ new ArgeoLoginContext(KernelHeader.LOGIN_CONTEXT_USER, subject)
+ .logout();
+ new ArgeoLoginContext(KernelHeader.LOGIN_CONTEXT_ANONYMOUS, subject)
+ .login();
+ } catch (LoginException e1) {
+ throw new ArgeoException("Cannot authenticate anonymous", e1);
+ }
+ close();
+ dispose();
+ cmsSession.authChange();
+ }
+
+ @Override
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ ((NameCallback) callbacks[0]).setName(username.getText());
+ ((PasswordCallback) callbacks[1]).setPassword(password.getTextChars());
+ }
+