Search in sources :

Example 6 with ServerRunContext

use of org.eclipse.scout.rt.server.context.ServerRunContext in project scout.rt by eclipse.

the class DiagnosticServlet method doGet.

@Override
protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException {
    if (Subject.getSubject(AccessController.getContext()) == null) {
        servletResponse.sendError(HttpServletResponse.SC_FORBIDDEN);
        return;
    }
    lazyInit(servletRequest, servletResponse);
    createServletRunContext(servletRequest, servletResponse).run(new IRunnable() {

        @Override
        public void run() throws Exception {
            ServerRunContext serverRunContext = ServerRunContexts.copyCurrent();
            serverRunContext.withUserAgent(UserAgents.createDefault());
            serverRunContext.withSession(lookupServerSessionOnHttpSession(Sessions.randomSessionId(), serverRunContext.copy()));
            invokeDiagnosticService(serverRunContext);
        }
    }, ServletExceptionTranslator.class);
}
Also used : ServerRunContext(org.eclipse.scout.rt.server.context.ServerRunContext) IRunnable(org.eclipse.scout.rt.platform.util.concurrent.IRunnable) ServletException(javax.servlet.ServletException) IOException(java.io.IOException)

Aggregations

ServerRunContext (org.eclipse.scout.rt.server.context.ServerRunContext)6 IRunnable (org.eclipse.scout.rt.platform.util.concurrent.IRunnable)3 IOException (java.io.IOException)2 ServletException (javax.servlet.ServletException)2 ClientNotificationCollector (org.eclipse.scout.rt.server.clientnotification.ClientNotificationCollector)2 InterruptedIOException (java.io.InterruptedIOException)1 SocketException (java.net.SocketException)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 HttpSession (javax.servlet.http.HttpSession)1 ClientNotificationDispatcher (org.eclipse.scout.rt.client.clientnotification.ClientNotificationDispatcher)1 IFuture (org.eclipse.scout.rt.platform.job.IFuture)1 IServerSession (org.eclipse.scout.rt.server.IServerSession)1 ICacheEntry (org.eclipse.scout.rt.server.commons.cache.ICacheEntry)1 IRegistrationHandle (org.eclipse.scout.rt.server.context.RunMonitorCancelRegistry.IRegistrationHandle)1 ISession (org.eclipse.scout.rt.shared.ISession)1 ClientNotificationMessage (org.eclipse.scout.rt.shared.clientnotification.ClientNotificationMessage)1 NotificationHandlerRegistry (org.eclipse.scout.rt.shared.notification.NotificationHandlerRegistry)1