Examples of runInScope()


Examples of org.glassfish.jersey.process.internal.RequestScope.runInScope()

    @Override
    public Response invoke() throws ProcessingException, WebApplicationException {
        final ClientRuntime runtime = request().getClientRuntime();
        final RequestScope requestScope = runtime.getRequestScope();
        return requestScope.runInScope(new Producer<Response>() {
            @Override
            public Response call() throws ProcessingException {
                return new InboundJaxrsResponse(runtime.invoke(requestContext), requestScope);
            }
        });
View Full Code Here

Examples of org.glassfish.jersey.process.internal.RequestScope.runInScope()

        if (responseType == null) {
            throw new IllegalArgumentException(LocalizationMessages.RESPONSE_TYPE_IS_NULL());
        }
        final ClientRuntime runtime = request().getClientRuntime();
        final RequestScope requestScope = runtime.getRequestScope();
        return requestScope.runInScope(new Producer<T>() {
            @Override
            public T call() throws ProcessingException {
                try {
                    return translate(runtime.invoke(requestContext), requestScope, responseType);
                } catch (ProcessingException ex) {
View Full Code Here

Examples of org.glassfish.jersey.process.internal.RequestScope.runInScope()

        if (responseType == null) {
            throw new IllegalArgumentException(LocalizationMessages.RESPONSE_TYPE_IS_NULL());
        }
        final ClientRuntime runtime = request().getClientRuntime();
        final RequestScope requestScope = runtime.getRequestScope();
        return requestScope.runInScope(new Producer<T>() {
            @Override
            public T call() throws ProcessingException {
                try {
                    return translate(runtime.invoke(requestContext), requestScope, responseType);
                } catch (ProcessingException ex) {
View Full Code Here

Examples of org.glassfish.jersey.process.internal.RequestScope.runInScope()

                new MessagingBinders.MessageBodyProviders(null, RuntimeType.SERVER), new Binder());

        TestBinder.initProviders(locator);
        RequestScope scope = locator.getService(RequestScope.class);

        scope.runInScope(new Callable<Object>() {

            @Override
            public Object call() throws Exception {
                Providers instance = locator.getService(Providers.class);
View Full Code Here

Examples of org.glassfish.jersey.process.internal.RequestScope.runInScope()

    @Override
    public Response invoke() throws ProcessingException, WebApplicationException {
        final ClientRuntime runtime = request().getClientRuntime();
        final RequestScope requestScope = runtime.getRequestScope();
        return requestScope.runInScope(new Producer<Response>() {
            @Override
            public Response call() throws ProcessingException {
                return new InboundJaxrsResponse(runtime.invoke(requestContext), requestScope);
            }
        });
View Full Code Here

Examples of org.glassfish.jersey.process.internal.RequestScope.runInScope()

        if (responseType == null) {
            throw new IllegalArgumentException(LocalizationMessages.RESPONSE_TYPE_IS_NULL());
        }
        final ClientRuntime runtime = request().getClientRuntime();
        final RequestScope requestScope = runtime.getRequestScope();
        return requestScope.runInScope(new Producer<T>() {
            @Override
            public T call() throws ProcessingException {
                try {
                    return translate(runtime.invoke(requestContext), requestScope, responseType);
                } catch (final ProcessingException ex) {
View Full Code Here

Examples of org.glassfish.jersey.process.internal.RequestScope.runInScope()

        if (responseType == null) {
            throw new IllegalArgumentException(LocalizationMessages.RESPONSE_TYPE_IS_NULL());
        }
        final ClientRuntime runtime = request().getClientRuntime();
        final RequestScope requestScope = runtime.getRequestScope();
        return requestScope.runInScope(new Producer<T>() {
            @Override
            public T call() throws ProcessingException {
                try {
                    return translate(runtime.invoke(requestContext), requestScope, responseType);
                } catch (final ProcessingException ex) {
View Full Code Here

Examples of org.glassfish.jersey.process.internal.RequestScope.runInScope()

        final RequestScope requestScope = locator.getService(RequestScope.class);

        final MyInjectableSingleton myInjectableSingleton = locator.getService(MyInjectableSingleton.class);
        assertEquals(myInjectableSingleton, locator.getService(MyInjectableSingleton.class));

        final MyInjectablePerRequest myInjectablePerRequest = requestScope.runInScope(new Callable<MyInjectablePerRequest>() {

            @Override
            public MyInjectablePerRequest call() throws Exception {
                final MyInjectablePerRequest myInjectablePerRequest = locator.getService(MyInjectablePerRequest.class);
                assertEquals(myInjectablePerRequest, locator.getService(MyInjectablePerRequest.class));
View Full Code Here

Examples of org.glassfish.jersey.process.internal.RequestScope.runInScope()

                assertEquals(myInjectablePerRequest, locator.getService(MyInjectablePerRequest.class));
                return myInjectablePerRequest;
            }
        });

        requestScope.runInScope(new Runnable() {

            @Override
            public void run() {
                assertNotSame(myInjectablePerRequest, locator.getService(MyInjectablePerRequest.class));
            }
View Full Code Here

Examples of org.glassfish.jersey.process.internal.RequestScope.runInScope()

        final RequestScope requestScope = locator.getService(RequestScope.class);

        final MyInjectableSingleton myInjectableSingleton = locator.getService(MyInjectableSingleton.class);
        assertEquals(myInjectableSingleton, locator.getService(MyInjectableSingleton.class));

        final MyInjectablePerRequest myInjectablePerRequest = requestScope.runInScope(new Callable<MyInjectablePerRequest>() {
            @Override
            public MyInjectablePerRequest call() throws Exception {
                final MyInjectablePerRequest myInjectablePerRequest = locator.getService(MyInjectablePerRequest.class);
                assertEquals(myInjectablePerRequest, locator.getService(MyInjectablePerRequest.class));
                return myInjectablePerRequest;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.