+ // logoutAction = ActionFactory.QUIT.create(window);
+
+ Subject subject = null;
+ try {
+ subject = SecureRapActivator.getLoginContext().getSubject();
+ } catch (LoginException e1) {
+ throw new ArgeoException("Cannot retrieve subject", e1);
+ }
+ final Principal principal = subject.getPrincipals().iterator().next();
+
+ logoutAction = new Action() {
+ public String getId() {
+ return SecureRapActivator.ID + ".logoutAction";
+ }
+
+ public String getText() {
+ return "Logout " + principal.getName();
+ }
+
+ public void run() {
+ try {
+ Subject subject = SecureRapActivator.getLoginContext()
+ .getSubject();
+ String subjectStr = subject.toString();
+ SecureRapActivator.getLoginContext().logout();
+ log.info(subjectStr + " logged out");
+ } catch (LoginException e) {
+ log.error("Error when logging out", e);
+ }
+ try {
+ RWT.getRequest().getSession().setMaxInactiveInterval(1);
+ PlatformUI.getWorkbench().close();
+ } catch (Exception e) {
+ if (log.isTraceEnabled())
+ log.trace("Error when invalidating session", e);
+ }
+ }
+
+ };
+ register(logoutAction);