+ protected IAction createLogoutAction() {
+ Subject subject = Subject.getSubject(AccessController.getContext());
+ final String username = subject.getPrincipals().iterator().next()
+ .getName();
+
+ IAction logoutAction = new Action() {
+ public String getId() {
+ return SecureRapActivator.ID + ".logoutAction";
+ }
+
+ public String getText() {
+ return "Logout " + username;
+ }
+
+ public void run() {
+ // try {
+ // Subject subject = SecureRapActivator.getLoginContext()
+ // .getSubject();
+ // String subjectStr = subject.toString();
+ // subject.getPrincipals().clear();
+ // SecureRapActivator.getLoginContext().logout();
+ // log.info(subjectStr + " logged out");
+ // } catch (LoginException e) {
+ // log.error("Error when logging out", e);
+ // }
+// SecureEntryPoint.logout(username);
+// PlatformUI.getWorkbench().close();
+ // try {
+ // RWT.getRequest().getSession().setMaxInactiveInterval(1);
+ // } catch (Exception e) {
+ // if (log.isTraceEnabled())
+ // log.trace("Error when invalidating session", e);
+ // }
+ }
+
+ };
+ return logoutAction;
+ }
+