Package org.glassfish.jersey.server

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


    }

    @Override
    protected Application configure() {
        ResourceConfig config = new ResourceConfig(HelloWorldResource.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(CookieResource.class);
        config.register(new LoggingFilter(LOGGER, true));
        return config;
    }

    @Test
    public void testCookieResource() {
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

    }

    @Override
    protected Application configure() {
        ResourceConfig config = new ResourceConfig(HelloWorldResource.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(Resource.class);
        config.register(new LoggingFilter(LOGGER, true));
        return config;
    }

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

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

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

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

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

        final ResourceConfig app = new ResourceConfig(
                PatchableResource.class,
                OptionsAcceptPatchHeaderFilter.class,
                PatchingInterceptor.class);

        app.register(createMoxyJsonResolver());

        // Enable on-demand tracing
        app.property(ServerProperties.TRACING, "ON_DEMAND");

        return app;
View Full Code Here

           
            System.out.println("\"Declarative Linking\" Jersey Example App");

            final ResourceConfig resourceConfig = new ResourceConfig(ItemsResource.class);
            resourceConfig.register(DeclarativeLinkingFeature.class);
            final HttpServer server = GrizzlyHttpServerFactory.createHttpServer(BASE_URI, resourceConfig);


            System.out.println(String.format("Application started.\nTry out curl -L %s%s\nHit enter to stop it...",
                    BASE_URI, ROOT_PATH));
View Full Code Here

    @Override
    protected ResourceConfig configure() {
        enable(TestProperties.LOG_TRAFFIC);
        final ResourceConfig rc = new ResourceConfig(ItemsResource.class);
        rc.register(DeclarativeLinkingFeature.class);
        return rc;
    }

    /**
     * Test that the expected response is sent back.
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.