Clarify implementation-specific APIs
[lgpl/argeo-commons.git] / swt / rcp / org.argeo.cms.e4.rcp / src / org / argeo / cms / e4 / rcp / CmsE4Application.java
index b37a76587c1a82f0e5292ec6e650b0c33b5fd432..3861597aad00baa1b232366cc923d22e9fb45a60 100644 (file)
@@ -2,6 +2,7 @@ package org.argeo.cms.e4.rcp;
 
 import java.security.PrivilegedExceptionAction;
 import java.util.UUID;
+import java.util.concurrent.Callable;
 
 import javax.security.auth.Subject;
 import javax.security.auth.login.LoginContext;
@@ -11,8 +12,7 @@ import org.argeo.api.cms.CmsAuth;
 import org.argeo.api.cms.ux.CmsImageManager;
 import org.argeo.api.cms.ux.CmsView;
 import org.argeo.api.cms.ux.UxContext;
-import org.argeo.cms.auth.CurrentUser;
-import org.argeo.cms.swt.CmsException;
+import org.argeo.cms.CurrentUser;
 import org.argeo.cms.swt.CmsSwtUtils;
 import org.argeo.cms.swt.SimpleSwtUxContext;
 import org.argeo.cms.swt.auth.CmsLoginShell;
@@ -155,7 +155,7 @@ public class CmsE4Application implements IApplication, CmsView {
        @Override
        public void authChange(LoginContext loginContext) {
                if (loginContext == null)
-                       throw new CmsException("Login context cannot be null");
+                       throw new IllegalStateException("Login context cannot be null");
                // logout previous login context
                // if (this.loginContext != null)
                // try {
@@ -169,12 +169,12 @@ public class CmsE4Application implements IApplication, CmsView {
        @Override
        public void logout() {
                if (loginContext == null)
-                       throw new CmsException("Login context should not bet null");
+                       throw new IllegalStateException("Login context should not bet null");
                try {
                        CurrentUser.logoutCmsSession(loginContext.getSubject());
                        loginContext.logout();
                } catch (LoginException e) {
-                       throw new CmsException("Cannot log out", e);
+                       throw new IllegalStateException("Cannot log out", e);
                }
        }
 
@@ -204,4 +204,9 @@ public class CmsE4Application implements IApplication, CmsView {
                return uid;
        }
 
+       @Override
+       public <T> T doAs(Callable<T> action) {
+               throw new UnsupportedOperationException();
+       }
+
 }