Package org.glassfish.jersey.server

Examples of org.glassfish.jersey.server.ResourceConfig$State


        }
    }

    @Override
    protected Application configure() {
        ResourceConfig config = new ResourceConfig(TracingResource.class);
        config.register(new LoggingFilter(LOGGER, true));
        final Resource.Builder resourceBuilder = Resource.builder(ROOT_PATH_PROGRAMMATIC);
        resourceBuilder.addMethod(TRACE.NAME).handledBy(new Inflector<ContainerRequestContext, Response>() {

            @Override
            public Response apply(ContainerRequestContext request) {
                if (request == null) {
                    return Response.noContent().build();
                } else {
                    return Response.ok(stringify((ContainerRequest) request), MediaType.TEXT_PLAIN).build();
                }
            }
        });

        return config.registerResources(resourceBuilder.build());

    }
View Full Code Here


        }
    }

    @Override
    protected Application configure() {
        ResourceConfig config = new ResourceConfig(HttpMethodResource.class);
        config.register(new LoggingFilter(LOGGER, true));
        return config;
    }
View Full Code Here

        }
    }

    @Override
    protected Application configure() {
        ResourceConfig config = new ResourceConfig(HttpMethodResource.class);
        config.register(new LoggingFilter(LOGGER, true));
        return config;
    }
View Full Code Here

        }
    }

    @Override
    protected Application configure() {
        ResourceConfig config = new ResourceConfig(HttpMethodResource.class);
        config.register(new LoggingFilter(LOGGER, true));
        return config;
    }
View Full Code Here

    private static final Logger LOGGER = Logger.getLogger(AuthFilterTest.class.getName());

    @Override
    protected Application configure() {
        ResourceConfig config = new ResourceConfig(AuthTest.AuthResource.class);
        config.register(new LoggingFilter(LOGGER, true));
        return config;
    }
View Full Code Here

        sslContextFactory.setKeyStoreResource(Resource.newResource(keyStore))// contains server keypair
        sslContextFactory.setKeyStorePassword("asdfgh");
        sslContextFactory.setTrustStoreResource(Resource.newResource(trustStore)); // contains client certificate
        sslContextFactory.setTrustStorePassword("asdfgh");

        ResourceConfig rc = new ResourceConfig();
        rc.register(new LoggingFilter(LOGGER, true));
        rc.registerClasses(RootResource.class, SecurityFilter.class, AuthenticationExceptionMapper.class);

        try {
            webServer = JettyHttpContainerFactory.createServer(
                    getBaseURI(),
                    sslContextFactory,
View Full Code Here

        }
    }

    @Test
    public void testJdkHttpPackage() {
        final ResourceConfig rc = new ResourceConfig();
        rc.packages(this.getClass().getPackage().getName());

        startServer(rc);

        WebTarget r = ClientBuilder.newClient().target(getUri().path("/").build());
View Full Code Here

    @Override
    protected DeploymentContext configureDeployment() {
        forceSet(TestProperties.CONTAINER_PORT, "0");

        return DeploymentContext.builder(new ResourceConfig(TestResource.class)).build();
    }
View Full Code Here

*/
public class GrizzlyPackageTest extends JerseyTest {
    @Override
    protected ResourceConfig configure() {
        enable(TestProperties.LOG_TRAFFIC);
        return new ResourceConfig().packages(this.getClass().getPackage().getName());
    }
View Full Code Here

    }

    @Test
    public void testCreateHttpServer() throws Exception {
        server = JdkHttpServerFactory.createHttpServer(
                UriBuilder.fromUri("http://localhost/").port(getPort()).build(), new ResourceConfig(TestResource.class));

        assertThat(server, instanceOf(HttpServer.class));
        assertThat(server, not(instanceOf(HttpsServer.class)));
    }
View Full Code Here

TOP

Related Classes of org.glassfish.jersey.server.ResourceConfig$State

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.