Package javax.ws.rs.core

Examples of javax.ws.rs.core.Configuration


@Priority(AutoDiscoverable.DEFAULT_PRIORITY)
public class HtmlJsonAutoDiscoverable implements AutoDiscoverable {

    @Override
    public void configure(final FeatureContext context) {
        final Configuration config = context.getConfiguration();

        if (!config.isRegistered(HtmlJsonProvider.class)) {
            context.register(HtmlJsonProvider.class);
        }
    }
View Full Code Here


*/
@Priority(AutoDiscoverable.DEFAULT_PRIORITY)
public final class SseAutoDiscoverable implements AutoDiscoverable {
    @Override
    public void configure(final FeatureContext context) {
        final Configuration config = context.getConfiguration();
        if (context.getConfiguration().isRegistered(SseFeature.class)) {
            return;
        }

        if (!PropertiesHelper.getValue(
                config.getProperties(), config.getRuntimeType(), SseFeature.DISABLE_SSE, Boolean.FALSE, Boolean.class, null)) {
            context.register(SseFeature.class);
        }
    }
View Full Code Here

    public static final String TEMPLATES_BASE_PATH = MvcFeature.TEMPLATE_BASE_PATH + SUFFIX;


    @Override
    public boolean configure(final FeatureContext context) {
        final Configuration config = context.getConfiguration();

        if (!config.isRegistered(JspTemplateProcessor.class)) {
            // Template Processor.
            context.register(JspTemplateProcessor.class);

            // MvcFeature.
            if (!config.isRegistered(MvcFeature.class)) {
                context.register(MvcFeature.class);
            }

            return true;
        }
View Full Code Here

        final JerseyClient jerseyClient =
                new JerseyClient(clientConfig, (UnsafeValue<SSLContext, IllegalStateException>) null, null);
        clientConfig = jerseyClient.getConfiguration();
        clientConfig.getRuntime();

        final Configuration runtimeConfig = clientConfig.getRuntime().getConfig();

        assertTrue(runtimeConfig.isEnabled(emptyFeature));
    }
View Full Code Here

        final JerseyClient jerseyClient =
                new JerseyClient(clientConfig, (UnsafeValue<SSLContext, IllegalStateException>) null, null);
        clientConfig = jerseyClient.getConfiguration();
        clientConfig.getRuntime();

        final Configuration runtimeConfig = clientConfig.getRuntime().getConfig();

        assertTrue(runtimeConfig.isEnabled(EmptyFeature.class));
    }
View Full Code Here

        private static final String INVOKED_BY_TEST_FILTER = "invoked-by-test-filter";

        @Override
        public void filter(ClientRequestContext requestContext) {
            final Configuration config = requestContext.getConfiguration();
            final JerseyClient client = new JerseyClientBuilder().withConfig(config).build();

            try {
                if (requestContext.getPropertyNames().contains(INVOKED_BY_TEST_FILTER)) {
                    return; // prevent the infinite recursion...
View Full Code Here

@Priority(AutoDiscoverable.DEFAULT_PRIORITY)
public final class ServerFiltersAutoDiscoverable implements AutoDiscoverable {

    @Override
    public void configure(final FeatureContext context) {
        final Configuration config = context.getConfiguration();

        // UriConnegFilter.
        final Object languageMappings = config.getProperty(ServerProperties.LANGUAGE_MAPPINGS);
        final Object mediaTypesMappings = config.getProperty(ServerProperties.MEDIA_TYPE_MAPPINGS);

        if (!config.isRegistered(UriConnegFilter.class)
                && (languageMappings != null || mediaTypesMappings != null)) {
            context.register(UriConnegFilter.class);
        }
    }
View Full Code Here

@ConstrainedTo(RuntimeType.SERVER)
public class MvcBeanValidationFeature implements Feature {

    @Override
    public boolean configure(final FeatureContext context) {
        final Configuration config = context.getConfiguration();

        if (!config.isRegistered(ValidationErrorTemplateExceptionMapper.class)) {
            // Exception Mapper.
            context.register(ValidationErrorTemplateExceptionMapper.class);

            // BeanValidation feature.
            if (!config.isRegistered(ValidationFeature.class)) {
                context.register(ValidationFeature.class);
            }

            // Mvc feature.
            if (!config.isRegistered(MvcFeature.class)) {
                context.register(MvcFeature.class);
            }

            return true;
        }
View Full Code Here

   public void testBuilder() throws Exception
   {
      String property = "prop";
      Client client = ClientBuilder.newClient();
      client.property(property, property);
      Configuration config = client.getConfiguration();
      client = ClientBuilder.newClient(config);

   }
View Full Code Here

        this.runtimeModelBuilder = runtimeModelBuilder;
        this.locatorModel = locatorModel;
        this.valueProviders = ParameterValueHelper.createValueProviders(locator, locatorModel.getInvocable());
        this.resourceContext = locator.getService(JerseyResourceContext.class);

        final Configuration config = locator.getService(Configuration.class);
        this.disableValidation = PropertiesHelper.getValue(config.getProperties(),
                ServerProperties.RESOURCE_VALIDATION_DISABLE,
                Boolean.FALSE,
                Boolean.class);
        this.ignoreValidationErrors = PropertiesHelper.getValue(config.getProperties(),
                ServerProperties.RESOURCE_VALIDATION_IGNORE_ERRORS,
                Boolean.FALSE,
                Boolean.class);
    }
View Full Code Here

TOP

Related Classes of javax.ws.rs.core.Configuration

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.