Package org.glassfish.jersey.server.spi

Examples of org.glassfish.jersey.server.spi.RequestScopedInitializer


        for (Map.Entry<String, String> header : vertxRequest.headers().entries()) {
            jerseyRequest.getHeaders().add(header.getKey(), header.getValue());
        }

        // Set request scoped instances
        jerseyRequest.setRequestScopedInitializer(new RequestScopedInitializer() {
            @Override
            public void initialize(ServiceLocator locator) {
                locator.<Ref<Vertx>>getService((new TypeLiteral<Ref<Vertx>>() {
                }).getType()).set(vertx);
                locator.<Ref<Container>>getService((new TypeLiteral<Ref<Container>>() {
View Full Code Here


     */
    @Override
    public RequestProcessingContext apply(final RequestProcessingContext context) {
        processingContextRefProvider.get().set(context);

        final RequestScopedInitializer requestScopedInitializer = context.request().getRequestScopedInitializer();
        if (requestScopedInitializer != null) {
            requestScopedInitializer.initialize(locator);
        }

        return context;
    }
View Full Code Here

                    configSetStatusOverSendError,
                    servletResponse,
                    asyncExtensionDelegate.createDelegate(servletRequest, servletResponse),
                    backgroundTaskScheduler);

            requestContext.setRequestScopedInitializer(new RequestScopedInitializer() {
                @Override
                public void initialize(ServiceLocator locator) {
                    locator.<Ref<HttpServletRequest>>getService(RequestTYPE).set(servletRequest);
                    locator.<Ref<HttpServletResponse>>getService(ResponseTYPE).set(servletResponse);
                }
View Full Code Here

        for (Map.Entry<String, String> header : vertxRequest.headers().entries()) {
            jerseyRequest.getHeaders().add(header.getKey(), header.getValue());
        }

        // Set request scoped instances
        jerseyRequest.setRequestScopedInitializer(new RequestScopedInitializer() {
            @Override
            public void initialize(ServiceLocator locator) {
                locator.<Ref<HttpServerRequest>>getService((new TypeLiteral<Ref<HttpServerRequest>>() {
                }).getType()).set(vertxRequest);
                locator.<Ref<HttpServerResponse>>getService((new TypeLiteral<Ref<HttpServerResponse>>() {
View Full Code Here

        for (Map.Entry<String, String> header : vertxRequest.headers().entries()) {
            jerseyRequest.getHeaders().add(header.getKey(), header.getValue());
        }

        // Set request scoped instances
        jerseyRequest.setRequestScopedInitializer(new RequestScopedInitializer() {
            @Override
            public void initialize(ServiceLocator locator) {
                locator.<Ref<HttpServerRequest>>getService((new TypeLiteral<Ref<HttpServerRequest>>() {
                }).getType()).set(vertxRequest);
                locator.<Ref<HttpServerResponse>>getService((new TypeLiteral<Ref<HttpServerResponse>>() {
View Full Code Here

            for (final String headerName : request.headers().names()) {
                requestContext.headers(headerName, request.headers().get(headerName));
            }
            requestContext.setWriter(responseWriter);
            requestContext.setRequestScopedInitializer(new RequestScopedInitializer() {
                @Override
                public void initialize(final ServiceLocator locator) {
                    locator.<Ref<YokeRequest>>getService(YOKE_REQUEST_TYPE).set(request);
                    locator.<Ref<YokeResponse>>getService(YOKE_RESPONSE_TYPE).set(response);
                    locator.<Ref<Vertx>>getService(VERTX_TYPE).set(vertx());
View Full Code Here

            requestContext.setEntityStream(request.getInputStream());
            for (String headerName : request.getNames()) {
                requestContext.headers(headerName, request.getValue(headerName));
            }
            requestContext.setWriter(responseWriter);
            requestContext.setRequestScopedInitializer(new RequestScopedInitializer() {
                @Override
                public void initialize(ServiceLocator locator) {
                    locator.<Ref<Request>>getService((new TypeLiteral<Ref<Request>>() {
                    }).getType()).set(request);
                    locator.<Ref<Response>>getService((new TypeLiteral<Ref<Response>>() {
View Full Code Here

                    configSetStatusOverSendError,
                    servletResponse,
                    asyncExtensionDelegate.createDelegate(servletRequest, servletResponse),
                    backgroundTaskScheduler);

            requestContext.setRequestScopedInitializer(new RequestScopedInitializer() {
                @Override
                public void initialize(final ServiceLocator locator) {
                    locator.<Ref<HttpServletRequest>>getService(REQUEST_TYPE).set(servletRequest);
                    locator.<Ref<HttpServletResponse>>getService(RESPONSE_TYPE).set(servletResponse);
                }
View Full Code Here

            while (headerNames.hasMoreElements()) {
                final String headerName = headerNames.nextElement();
                requestContext.headers(headerName, request.getHeader(headerName));
            }
            requestContext.setWriter(responseWriter);
            requestContext.setRequestScopedInitializer(new RequestScopedInitializer() {
                @Override
                public void initialize(final ServiceLocator locator) {
                    locator.<Ref<Request>>getService(REQUEST_TYPE).set(request);
                    locator.<Ref<Response>>getService(RESPONSE_TYPE).set(response);
                }
View Full Code Here

            requestContext.setEntityStream(request.getInputStream());
            for (final String headerName : request.getNames()) {
                requestContext.headers(headerName, request.getValue(headerName));
            }
            requestContext.setWriter(responseWriter);
            requestContext.setRequestScopedInitializer(new RequestScopedInitializer() {
                @Override
                public void initialize(final ServiceLocator locator) {
                    locator.<Ref<Request>>getService(RequestTYPE).set(request);
                    locator.<Ref<Response>>getService(ResponseTYPE).set(response);
                }
View Full Code Here

TOP

Related Classes of org.glassfish.jersey.server.spi.RequestScopedInitializer

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.