import static org.eclipse.rap.rwt.internal.service.ContextProvider.getApplicationContext;
+import java.net.URI;
+import java.net.URISyntaxException;
import java.security.PrivilegedAction;
import java.util.Locale;
import java.util.UUID;
return cmsSession;
}
+ @Override
+ public URI toBackendUri(String url) {
+ try {
+ return new URI(url);
+ } catch (URISyntaxException e) {
+ throw new IllegalArgumentException("Cannot convert " + url, e);
+ }
+ }
+
/*
* EntryPoint IMPLEMENTATION
*/
Subject.doAs(loginContext.getSubject(), new PrivilegedAction<Void>() {
@Override
public Void run() {
+ // TODO rather loop here, until there is an auth change
if (!display.readAndDispatch()) {
+ // TODO update UI last access here
display.sleep();
}
return null;
}
});
- } catch (Throwable e) {
- if (e instanceof SWTError) {
- SWTError swtError = (SWTError) e;
- if (swtError.code == SWT.ERROR_FUNCTION_DISPOSED) {
+ } catch (SWTError e) {
+ SWTError swtError = (SWTError) e;
+ if (swtError.code == SWT.ERROR_FUNCTION_DISPOSED) {
+ if (log.isTraceEnabled())
log.error("Unexpected SWT error in event loop, ignoring it. " + e.getMessage());
- continue eventLoop;
- } else {
- log.error("Unexpected SWT error in event loop, shutting down...", e);
- break eventLoop;
- }
- } else if (e instanceof ThreadDeath) {
- throw (ThreadDeath) e;
-// } else if (e instanceof Error) {
-// log.error("Unexpected error in event loop, shutting down...", e);
-// break eventLoop;
- } else {
- log.error("Unexpected exception in event loop, ignoring it. " + e.getMessage());
continue eventLoop;
+ } else {
+ log.error("Unexpected SWT error in event loop, shutting down...", e);
+ break eventLoop;
}
+ } catch (ThreadDeath e) {
+ // ThreadDeath is expected when the UI thread terminates
+ throw (ThreadDeath) e;
+ } catch (Error e) {
+ log.error("Unexpected error in event loop, shutting down...", e);
+ break eventLoop;
+ } catch (Throwable e) {
+ log.error("Unexpected exception in event loop, ignoring it. " + e.getMessage());
+ continue eventLoop;
}
}
+ if (serverPushSession != null)
+ serverPushSession.stop();
if (!display.isDisposed())
display.dispose();
}