Package io.undertow.servlet.api

Examples of io.undertow.servlet.api.Deployment


        requestImpl.getExchange().setRequestPath(newRequestUri);
        requestImpl.getExchange().setRequestURI(newRequestUri);
        requestImpl.setServletContext((ServletContextImpl) context);
        responseImpl.setServletContext((ServletContextImpl) context);

        Deployment deployment = requestImpl.getServletContext().getDeployment();
        ServletPathMatch info = deployment.getServletPaths().getServletHandlerByPath(newServletPath);
        requestImpl.getExchange().getAttachment(ServletRequestContext.ATTACHMENT_KEY).setServletPathMatch(info);

        dispatchAsyncRequest(deployment.getServletDispatcher(), info, exchange);
    }
View Full Code Here


    @Override
    public void dispatch() {
        final HttpServletRequestImpl requestImpl = HttpServletRequestImpl.getRequestImpl(servletRequest);
        final ServletPathMatch handler;
        Deployment deployment = requestImpl.getServletContext().getDeployment();
        if (servletRequest instanceof HttpServletRequest) {
            handler = deployment.getServletPaths().getServletHandlerByPath(((HttpServletRequest) servletRequest).getServletPath());
        } else {
            handler = deployment.getServletPaths().getServletHandlerByPath(exchange.getRelativePath());
        }

        final HttpServerExchange exchange = requestImpl.getExchange();

        exchange.putAttachment(HttpServletRequestImpl.DISPATCHER_TYPE_ATTACHMENT_KEY, DispatcherType.ASYNC);

        exchange.putAttachment(HttpServletRequestImpl.ATTACHMENT_KEY, servletRequest);
        exchange.putAttachment(HttpServletResponseImpl.ATTACHMENT_KEY, servletResponse);

        dispatchAsyncRequest(deployment.getServletDispatcher(), handler, exchange);
    }
View Full Code Here

        requestImpl.getExchange().setRequestPath(newRequestUri);
        requestImpl.getExchange().setRequestURI(newRequestUri);
        requestImpl.setServletContext((ServletContextImpl) context);
        responseImpl.setServletContext((ServletContextImpl) context);

        Deployment deployment = requestImpl.getServletContext().getDeployment();
        ServletPathMatch info = deployment.getServletPaths().getServletHandlerByPath(newServletPath);
        requestImpl.getExchange().putAttachment(ServletAttachments.SERVLET_PATH_MATCH, info);

        dispatchAsyncRequest(deployment.getServletDispatcher(), info, exchange);
    }
View Full Code Here

            final String path = CONTEXT_ROOT.resolveModelAttribute(context, subModel).asString();
            final String server = SERVER.resolveModelAttribute(context, subModel).asString();

            final ServiceController<?> controller = context.getServiceRegistry(false).getService(UndertowService.deploymentServiceName(server, host, path));
            final UndertowDeploymentService deploymentService = (UndertowDeploymentService) controller.getService();
            Deployment deployment = deploymentService.getDeployment();
            SessionManager sessionManager = deployment.getSessionManager();

            SessionStat stat = SessionStat.getStat(operation.require(ModelDescriptionConstants.NAME).asString());
            SessionManagerStatistics sms = sessionManager instanceof SessionManagerStatistics ? (SessionManagerStatistics) sessionManager : null;

            if (stat == null) {
View Full Code Here

            StartupContext.setInjectionContainer(webInjectionContainer);
            try {
                deploymentManager = container.getValue().getServletContainer().addDeployment(deploymentInfo);
                deploymentManager.deploy();
                HttpHandler handler = deploymentManager.start();
                Deployment deployment = deploymentManager.getDeployment();
                host.getValue().registerDeployment(deployment, handler);
            } finally {
                StartupContext.setInjectionContainer(null);
            }
        } finally {
View Full Code Here

        DeploymentInfo deploymentInfo = deploymentInfoInjectedValue.getValue();
        Thread.currentThread().setContextClassLoader(deploymentInfo.getClassLoader());
        try {
            FactoryFinderCache.clearClassLoader(deploymentInfo.getClassLoader());
            if (deploymentManager != null) {
                Deployment deployment = deploymentManager.getDeployment();
                try {
                    host.getValue().unregisterDeployment(deployment);
                    deploymentManager.stop();
                } catch (ServletException e) {
                    throw new RuntimeException(e);
View Full Code Here

        @Override
        public ServletContext getServletContext() {
            UndertowDeploymentService service = controller.getValue();
            DeploymentManager manager = service.deploymentManager;
            Deployment deployment = manager != null ? manager.getDeployment() : null;
            return deployment != null ? deployment.getServletContext() : null;
        }
View Full Code Here

        assertSame(this.engine, this.host.getEngine());
    }
   
    @Test
    public void getContexts() {
        Deployment deployment = mock(Deployment.class);
        DeploymentInfo info = new DeploymentInfo();
        String expectedPath = "/";
        info.setContextPath(expectedPath);
        HttpHandler handler = mock(HttpHandler.class);
       
        when(deployment.getDeploymentInfo()).thenReturn(info);
       
        this.undertowHost.registerDeployment(deployment, handler);
       
        Iterator<Context> result = this.host.getContexts().iterator();
       
View Full Code Here

        assertFalse(result.hasNext());
    }
   
    @Test
    public void findContext() {
        Deployment deployment = mock(Deployment.class);
        DeploymentInfo info = new DeploymentInfo();
        String expectedPath = "/";
        info.setContextPath(expectedPath);
        HttpHandler handler = mock(HttpHandler.class);
       
        when(deployment.getDeploymentInfo()).thenReturn(info);
       
        this.undertowHost.registerDeployment(deployment, handler);
       
        Context result = this.host.findContext(expectedPath);
       
View Full Code Here

                return true;
            }
        }

        final ServletChain servlet = servletRequestContext.getCurrentServlet();
        final Deployment deployment = servletContext.getDeployment();
        final AuthorizationManager authorizationManager = deployment.getDeploymentInfo().getAuthorizationManager();
        return authorizationManager.isUserInRole(role, account, servlet.getManagedServlet().getServletInfo(), this, deployment);
    }
View Full Code Here

TOP

Related Classes of io.undertow.servlet.api.Deployment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.