Package javax.ws.rs.container

Examples of javax.ws.rs.container.ContainerRequestFilter


    }
   
    private void addContainerRequestFilter(
        List<ProviderInfo<ContainerRequestFilter>> postMatchFilters,
        ProviderInfo<ContainerRequestFilter> p) {
        ContainerRequestFilter filter = p.getProvider();
        if (isWadlGenerator(filter.getClass())) {
            wadlGenerator = p;
        } else {
            if (isPrematching(filter.getClass())) {
                addProviderToList(preMatchContainerRequestFilters, p);
            } else {
                postMatchFilters.add(p);
            }
        }
View Full Code Here


    public static class SupportedProvidersDynamicFeature implements DynamicFeature {

        @Override
        public void configure(final ResourceInfo resourceInfo, final FeatureContext context) {
            context.register(ProviderBall.class);
            context.register(new ContainerRequestFilter() {
                @Override
                public void filter(final ContainerRequestContext requestContext) throws IOException {
                    requestContext.getHeaders().add("foo", "bar");
                }
            });
View Full Code Here

        ProviderBinder providerBinder = new ProviderBinder(locator);
        providerBinder.bindClasses(Child.class);
        providerBinder.bindClasses(NotFilterChild.class);

        ContainerRequestFilter requestFilter = getRequestFilter(locator);
        ContainerRequestFilter requestFilter2 = getRequestFilter(locator);
        assertEquals(requestFilter, requestFilter2);


        ContainerResponseFilter responseFilter = getResponseFilter(locator);
        ContainerResponseFilter responseFilter2 = getResponseFilter(locator);
View Full Code Here

        assertEquals(Child.class, responseFilter.getClass());
        return responseFilter;
    }

    private ContainerRequestFilter getRequestFilter(ServiceLocator locator) {
        ContainerRequestFilter requestFilter = locator.getService(ContainerRequestFilter.class, new CustomAnnotationImpl());
        assertEquals(Child.class, requestFilter.getClass());
        return requestFilter;
    }
View Full Code Here

    public void testSingleRequestFilter() throws Exception {

        final AtomicInteger called = new AtomicInteger(0);

        final List<ContainerRequestFilter> requestFilters = Lists.newArrayList();
        requestFilters.add(new ContainerRequestFilter() {
            @Override
            public void filter(final ContainerRequestContext context) throws IOException {
                called.incrementAndGet();
            }
        });
View Full Code Here

    }
   
    private void addContainerRequestFilter(
        List<ProviderInfo<ContainerRequestFilter>> postMatchFilters,
        ProviderInfo<ContainerRequestFilter> p) {
        ContainerRequestFilter filter = p.getProvider();
        if (isWadlGenerator(filter.getClass())) {
            wadlGenerator = p;
        } else {
            if (isPrematching(filter.getClass())) {
                addProviderToList(preMatchContainerRequestFilters, p);
            } else {
                postMatchFilters.add(p);
            }
        }
View Full Code Here

TOP

Related Classes of javax.ws.rs.container.ContainerRequestFilter

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.