Package org.glassfish.jersey.server

Examples of org.glassfish.jersey.server.ResourceConfig.register()


        return UriBuilder.fromUri("http://localhost").port(getPort()).path(CONTEXT);
    }

    public void startServer(Class... resources) {
        ResourceConfig config = new ResourceConfig(resources);
        config.register(new LoggingFilter(LOGGER, true));
        final URI baseUri = getBaseUri();
        server = JettyHttpContainerFactory.createServer(baseUri, config);
        LOGGER.log(Level.INFO, "Jetty-http server started on base uri: " + baseUri);
    }
View Full Code Here


    }

    @Override
    protected Application configure() {
        ResourceConfig config = new ResourceConfig(EntityResource.class, JacksonFeature.class);
        config.register(new LoggingFilter(LOGGER, true));
        return config;
    }

    @Override
    protected void configureClient(ClientConfig config) {
View Full Code Here

    }

    @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) {
View Full Code Here

    }

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

    @Override
    protected void configureClient(ClientConfig config) {
View Full Code Here

    }

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

    @Override
    protected void configureClient(ClientConfig config) {
View Full Code Here

    }

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

    @Override
    protected void configureClient(ClientConfig 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;
    }


    @Override
View Full Code Here

        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(),
View Full Code Here

        sslContext.setKeyStorePass("asdfgh");
        sslContext.setTrustStoreBytes(ByteStreams.toByteArray(trustStore)); // contains client certificate
        sslContext.setTrustStorePass("asdfgh");

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

        try {
            webServer = GrizzlyHttpServerFactory.createHttpServer(
                    getBaseURI(),
View Full Code Here

    }

    @Override
    protected Application configure() {
        ResourceConfig config = new ResourceConfig(RedirectResource.class);
        config.register(new LoggingFilter(LOGGER, true));
        return config;
    }

    @Override
    protected void configureClient(ClientConfig config) {
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.