Package org.glassfish.jersey.server
Class ResourceConfig.State
- java.lang.Object
-
- org.glassfish.jersey.model.internal.CommonConfig
-
- org.glassfish.jersey.server.ResourceConfig.State
-
- All Implemented Interfaces:
javax.ws.rs.core.Configurable<javax.ws.rs.core.FeatureContext>,javax.ws.rs.core.Configuration,javax.ws.rs.core.FeatureContext,ExtendedConfig,ServerConfig
- Direct Known Subclasses:
ResourceConfig.ImmutableState
- Enclosing class:
- ResourceConfig
private static class ResourceConfig.State extends CommonConfig implements ServerConfig
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringapplicationNameprivate java.lang.ClassLoaderclassLoaderprivate java.util.Set<ResourceFinder>resourceFindersprivate java.util.Set<Resource>resourcesprivate java.util.Set<Resource>resourcesView
-
Constructor Summary
Constructors Constructor Description State()State(ResourceConfig.State original)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.StringgetApplicationName()java.lang.ClassLoadergetClassLoader()Get resource and provider class loader.ServerConfiggetConfiguration()protected Inflector<ContractProvider.Builder,ContractProvider>getModelEnhancer(java.lang.Class<?> componentClass)An extension point that provides a way how to define a custom enhancement/update operation of a contract provider model registration being produced for a given component class.java.util.Set<ResourceFinder>getResourceFinders()Get the registered resource finders.java.util.Set<Resource>getResources()Get programmatically modeled resources.ResourceConfig.StateloadFrom(javax.ws.rs.core.Configuration config)Load the internal configuration state from an externally provided configuration state.voidregisterFinder(ResourceFinder resourceFinder)voidregisterResources(java.util.Set<Resource> resources)voidsetApplicationName(java.lang.String applicationName)voidsetClassLoader(java.lang.ClassLoader classLoader)-
Methods inherited from class org.glassfish.jersey.model.internal.CommonConfig
addProperties, configureAutoDiscoverableProviders, configureMetaProviders, equals, getClasses, getComponentBag, getContracts, getInstances, getProperties, getProperty, getPropertyNames, getRuntimeType, hashCode, isEnabled, isEnabled, isProperty, isRegistered, isRegistered, property, register, register, register, register, register, register, register, register, setProperties
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.ws.rs.core.Configuration
getClasses, getContracts, getInstances, getProperties, getProperty, getPropertyNames, getRuntimeType, isEnabled, isEnabled, isRegistered, isRegistered
-
Methods inherited from interface org.glassfish.jersey.ExtendedConfig
isProperty
-
-
-
-
Field Detail
-
resourceFinders
private final java.util.Set<ResourceFinder> resourceFinders
-
resources
private final java.util.Set<Resource> resources
-
resourcesView
private final java.util.Set<Resource> resourcesView
-
applicationName
private volatile java.lang.String applicationName
-
classLoader
private volatile java.lang.ClassLoader classLoader
-
-
Constructor Detail
-
State
public State()
-
State
public State(ResourceConfig.State original)
-
-
Method Detail
-
setClassLoader
public void setClassLoader(java.lang.ClassLoader classLoader)
-
setApplicationName
public void setApplicationName(java.lang.String applicationName)
-
registerResources
public void registerResources(java.util.Set<Resource> resources)
-
registerFinder
public void registerFinder(ResourceFinder resourceFinder)
-
getModelEnhancer
protected Inflector<ContractProvider.Builder,ContractProvider> getModelEnhancer(java.lang.Class<?> componentClass)
Description copied from class:CommonConfigAn extension point that provides a way how to define a custom enhancement/update operation of a contract provider model registration being produced for a given component class. Default implementation return an enhancer just builds the model.Derived implementations may use this method to e.g. filter out all contracts not applicable in the given configuration context or change the model scope. The returned set of filtered contracts is then used for the actual provider registration.
- Overrides:
getModelEnhancerin classCommonConfig- Parameters:
componentClass- class of the component being registered.- Returns:
- filter for the contracts that being registered for a given component class.
-
loadFrom
public ResourceConfig.State loadFrom(javax.ws.rs.core.Configuration config)
Description copied from class:CommonConfigLoad 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:
loadFromin classCommonConfig- Parameters:
config- external configuration state to replace the configuration of this configurable instance.- Returns:
- the updated common configuration instance.
-
getResources
public final java.util.Set<Resource> getResources()
Description copied from interface:ServerConfigGet programmatically modeled resources.- Specified by:
getResourcesin interfaceServerConfig- Returns:
- programmatically modeled resources.
-
getConfiguration
public ServerConfig getConfiguration()
- Specified by:
getConfigurationin interfacejavax.ws.rs.core.Configurable<javax.ws.rs.core.FeatureContext>- Overrides:
getConfigurationin classCommonConfig
-
getResourceFinders
public java.util.Set<ResourceFinder> getResourceFinders()
Get the registered resource finders.- Returns:
- registered resource finders.
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Get resource and provider class loader.- Returns:
- class loader to be used when looking up the resource classes and providers.
-
getApplicationName
private java.lang.String getApplicationName()
-
-