Package org.jboss.arquillian.warp.spi.context

Examples of org.jboss.arquillian.warp.spi.context.RequestContext


    @Inject
    private Instance<RequestContext> requestContextInstance;

    public void createRequestContext(@Observes(precedence = 100) EventContext<BeforeRequest> context) {
        RequestContext requestContext = this.requestContextInstance.get();
        requestContext.activate();
        context.proceed();
    }
View Full Code Here


        requestContext.activate();
        context.proceed();
    }

    public void destroyRequestContext(@Observes(precedence = 100) EventContext<AfterRequest> context) {
        RequestContext requestContext = this.requestContextInstance.get();
        try {
            context.proceed();
        } finally {
            requestContext.deactivate();
        }
    }
View Full Code Here

    @Inject
    private Event<AfterRequest> afterRequest;

    public void handleRequestContext(@Observes(precedence = 100) EventContext<ProcessHttpRequest> context) {
        RequestContext testContext = this.requestContextInstance.get();

        String requestId = String.valueOf(context.getEvent().getRequest().getAttribute(WarpCommons.WARP_REQUEST_ID));
        try {
            testContext.activate(requestId);

            servletRequest.set(context.getEvent().getRequest());
            servletResponse.set(context.getEvent().getResponse());
            httpServletRequest.set(context.getEvent().getRequest());
            httpServletResponse.set(context.getEvent().getResponse());
            filterChain.set(context.getEvent().getFilterChain());

            beforeRequest.fire(new BeforeRequest(context.getEvent().getRequest(), context.getEvent().getResponse()));

            context.proceed();
        } finally {
            try {
                afterRequest.fire(new AfterRequest(context.getEvent().getRequest(), context.getEvent().getResponse()));
            } finally {
                testContext.deactivate();
                testContext.destroy(requestId);
            }
        }
    }
View Full Code Here

    @Inject
    private Instance<RequestContext> requestContextInstance;

    public void createRequestContext(@Observes(precedence = 100) EventContext<BeforeRequest> context) {
        ServletRequest request = context.getEvent().getRequest();
        RequestContext requestContext = this.requestContextInstance.get();
        requestContext.activate(request.hashCode());
        context.proceed();
    }
View Full Code Here

        requestContext.activate(request.hashCode());
        context.proceed();
    }

    public void destroyRequestContext(@Observes(precedence = 100) EventContext<AfterRequest> context) {
        RequestContext requestContext = this.requestContextInstance.get();
        try {
            context.proceed();
        } finally {
            requestContext.deactivate();
        }
    }
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.warp.spi.context.RequestContext

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.