Package org.glassfish.jersey.server

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


                                            final Set<? extends Binder> additionalBinders)
            throws EndpointRegistrationException {
        ResourceConfig rc = super.getResourceConfig(classes, sc, serviceLocator, additionalBinders);
        registerExtendedWadlConfig(classes, rc, serviceLocator);
        rc.register(ExceptionFilter.class);
        rc.property(ServerProperties.RESOURCE_LOCATOR_VALIDATION_DISABLE, Boolean.TRUE);
        return rc;
    }

    @Override
    public Set<Class<?>> getResourceClasses(ServiceLocator habitat) {
View Full Code Here


    private void _test(final String response, final Boolean globalDisable, final Boolean serverDisable) throws Exception {
        final ResourceConfig resourceConfig = new ResourceConfig(Resource.class, Filter.class);

        if (globalDisable != null) {
            resourceConfig.property(CommonProperties.JSON_PROCESSING_FEATURE_DISABLE, globalDisable);
        }
        if (serverDisable != null) {
            resourceConfig.property(ServerProperties.JSON_PROCESSING_FEATURE_DISABLE, serverDisable);
        }
View Full Code Here

        if (globalDisable != null) {
            resourceConfig.property(CommonProperties.JSON_PROCESSING_FEATURE_DISABLE, globalDisable);
        }
        if (serverDisable != null) {
            resourceConfig.property(ServerProperties.JSON_PROCESSING_FEATURE_DISABLE, serverDisable);
        }

        final ApplicationHandler app = new ApplicationHandler(resourceConfig);

        final URI baseUri = URI.create("/");
View Full Code Here

                PatchingInterceptor.class);

        app.register(createMoxyJsonResolver());

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

        return app;
    }

    /**
 
View Full Code Here

    protected Application configure() {
        final ResourceConfig rc = new ResourceConfig()
                .register(SpringLifecycleListener.class)
                .register(RequestContextFilter.class);
        TestUtil.registerHK2Services(rc);
        rc.property("contextConfigLocation", "classpath:applicationContext.xml");
        return configure(rc);
    }

    protected abstract ResourceConfig configure(ResourceConfig rc);
View Full Code Here

    }


    ResourceConfig createResourceConfig() {
        final ResourceConfig resourceConfig = new ResourceConfig(new MyApplication().getClasses());
        resourceConfig.property(ServerProperties.WADL_GENERATOR_CONFIG, SampleWadlGeneratorConfig.class.getName());

        return resourceConfig;
    }

    /**
 
View Full Code Here

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

    @Override
    protected DeploymentContext configureDeployment() {
        final ResourceConfig resourceConfig = new ResourceConfig(new MyApplication().getClasses());
        resourceConfig.property(ServerProperties.WADL_GENERATOR_CONFIG, "org.glassfish.jersey.examples.extendedwadl" +
                ".SampleWadlGeneratorConfig");

        final Resource.Builder resourceBuilder = Resource.builder();
        resourceBuilder.name("resource-programmatic").path("programmatic").addMethod("GET")
View Full Code Here

        } // class Resource

        @Override
        protected Application configure() {
            final ResourceConfig resourceConfig = new ResourceConfig(Resource.class);
            resourceConfig.property(ServerProperties.METAINF_SERVICES_LOOKUP_DISABLE, true);

            return resourceConfig;
        }

        @Test
View Full Code Here

    }

    @Test
    public void testMonitoringEnabledStatisticsDisabledByAutodiscovery() {
        final ResourceConfig resourceConfig = new ResourceConfig();
        resourceConfig.property(ServerProperties.MONITORING_ENABLED, true);
        resourceConfig.property(ServerProperties.MONITORING_STATISTICS_ENABLED, false);
        final ApplicationHandler applicationHandler = new ApplicationHandler(resourceConfig);

        final ResourceConfig config = applicationHandler.getConfiguration();
        Assert.assertTrue(config.isRegistered(ApplicationInfoListener.class));
View Full Code Here

    @Test
    public void testMonitoringEnabledStatisticsDisabledByAutodiscovery() {
        final ResourceConfig resourceConfig = new ResourceConfig();
        resourceConfig.property(ServerProperties.MONITORING_ENABLED, true);
        resourceConfig.property(ServerProperties.MONITORING_STATISTICS_ENABLED, false);
        final ApplicationHandler applicationHandler = new ApplicationHandler(resourceConfig);

        final ResourceConfig config = applicationHandler.getConfiguration();
        Assert.assertTrue(config.isRegistered(ApplicationInfoListener.class));
        Assert.assertFalse(config.isRegistered(MonitoringEventListener.class));
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.