org.glassfish.jersey.model.internal
Class ImmutableCommonConfig

java.lang.Object
  extended by org.glassfish.jersey.model.internal.CommonConfig
      extended by org.glassfish.jersey.model.internal.ImmutableCommonConfig
All Implemented Interfaces:
javax.ws.rs.core.Configurable<javax.ws.rs.core.FeatureContext>, javax.ws.rs.core.Configuration, javax.ws.rs.core.FeatureContext, ExtendedConfig

public class ImmutableCommonConfig
extends CommonConfig

Immutable runtime configuration.

Author:
Marek Potociar (marek.potociar at oracle.com)

Constructor Summary
ImmutableCommonConfig(CommonConfig config)
          Create new immutable copy of the original runtime configuration.
ImmutableCommonConfig(CommonConfig config, String modificationErrorMessage)
          Create new immutable copy of the original runtime configuration with a custom modification error message.
 
Method Summary
 CommonConfig loadFrom(javax.ws.rs.core.Configuration config)
          Load the internal configuration state from an externally provided configuration state.
 ImmutableCommonConfig property(String name, Object value)
           
 ImmutableCommonConfig register(Class<?> componentClass)
           
 ImmutableCommonConfig register(Class<?> componentClass, Class<?>... contracts)
           
 ImmutableCommonConfig register(Class<?> componentClass, int bindingPriority)
           
 CommonConfig register(Class<?> componentClass, Map<Class<?>,Integer> contracts)
           
 ImmutableCommonConfig register(Object component)
           
 ImmutableCommonConfig register(Object component, Class<?>... contracts)
           
 ImmutableCommonConfig register(Object component, int bindingPriority)
           
 CommonConfig register(Object component, Map<Class<?>,Integer> contracts)
           
 ImmutableCommonConfig setProperties(Map<String,?> properties)
          Set the configured properties to the provided map of properties.
 
Methods inherited from class org.glassfish.jersey.model.internal.CommonConfig
addProperties, configureAutoDiscoverableProviders, configureMetaProviders, equals, getClasses, getComponentBag, getConfiguration, getContracts, getInstances, getModelEnhancer, getProperties, getProperty, getPropertyNames, getRuntimeType, hashCode, isEnabled, isEnabled, isProperty, isRegistered, isRegistered
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImmutableCommonConfig

public ImmutableCommonConfig(CommonConfig config,
                             String modificationErrorMessage)
Create new immutable copy of the original runtime configuration with a custom modification error message.

Parameters:
config - original runtime configuration.
modificationErrorMessage - custom modification error message.

ImmutableCommonConfig

public ImmutableCommonConfig(CommonConfig config)
Create new immutable copy of the original runtime configuration.

Parameters:
config - original runtime configuration.
Method Detail

property

public ImmutableCommonConfig property(String name,
                                      Object value)
Specified by:
property in interface javax.ws.rs.core.Configurable<javax.ws.rs.core.FeatureContext>
Overrides:
property in class CommonConfig

setProperties

public ImmutableCommonConfig setProperties(Map<String,?> properties)
Description copied from class: CommonConfig
Set the configured properties to the provided map of properties.

Overrides:
setProperties in class CommonConfig
Parameters:
properties - new map of properties to be set.
Returns:
updated configuration instance.

register

public ImmutableCommonConfig register(Class<?> componentClass)
Specified by:
register in interface javax.ws.rs.core.Configurable<javax.ws.rs.core.FeatureContext>
Overrides:
register in class CommonConfig

register

public ImmutableCommonConfig register(Class<?> componentClass,
                                      int bindingPriority)
Specified by:
register in interface javax.ws.rs.core.Configurable<javax.ws.rs.core.FeatureContext>
Overrides:
register in class CommonConfig

register

public ImmutableCommonConfig register(Class<?> componentClass,
                                      Class<?>... contracts)
Specified by:
register in interface javax.ws.rs.core.Configurable<javax.ws.rs.core.FeatureContext>
Overrides:
register in class CommonConfig

register

public CommonConfig register(Class<?> componentClass,
                             Map<Class<?>,Integer> contracts)
Specified by:
register in interface javax.ws.rs.core.Configurable<javax.ws.rs.core.FeatureContext>
Overrides:
register in class CommonConfig

register

public ImmutableCommonConfig register(Object component)
Specified by:
register in interface javax.ws.rs.core.Configurable<javax.ws.rs.core.FeatureContext>
Overrides:
register in class CommonConfig

register

public ImmutableCommonConfig register(Object component,
                                      int bindingPriority)
Specified by:
register in interface javax.ws.rs.core.Configurable<javax.ws.rs.core.FeatureContext>
Overrides:
register in class CommonConfig

register

public ImmutableCommonConfig register(Object component,
                                      Class<?>... contracts)
Specified by:
register in interface javax.ws.rs.core.Configurable<javax.ws.rs.core.FeatureContext>
Overrides:
register in class CommonConfig

register

public CommonConfig register(Object component,
                             Map<Class<?>,Integer> contracts)
Specified by:
register in interface javax.ws.rs.core.Configurable<javax.ws.rs.core.FeatureContext>
Overrides:
register in class CommonConfig

loadFrom

public CommonConfig loadFrom(javax.ws.rs.core.Configuration config)
Description copied from class: CommonConfig
Load the internal configuration state from an externally provided configuration state.

Calling this method effectively replaces existing configuration state of the instance with the state represented by the externally provided configuration. If the features, auto-discoverables of given config has been already configured then this method will make sure to not configure them for the second time.

Overrides:
loadFrom in class CommonConfig
Parameters:
config - external configuration state to replace the configuration of this configurable instance.
Returns:
the updated common configuration instance.


Copyright © 2007-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.