|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.ws.rs.ext.RuntimeDelegate
org.jboss.resteasy.spi.ResteasyProviderFactory
public class ResteasyProviderFactory
| Nested Class Summary | |
|---|---|
protected static class |
ResteasyProviderFactory.SortedKey<T>
Allow us to sort message body implementations that are more specific for their types i.e. |
| Nested classes/interfaces inherited from class javax.ws.rs.ext.RuntimeDelegate |
|---|
RuntimeDelegate.HeaderDelegate<T> |
| Fields inherited from class javax.ws.rs.ext.RuntimeDelegate |
|---|
JAXRS_RUNTIME_DELEGATE_PROPERTY |
| Constructor Summary | |
|---|---|
ResteasyProviderFactory()
|
|
ResteasyProviderFactory(ResteasyProviderFactory parent)
Copies a specific component registry when a new provider is added. |
|
| Method Summary | ||
|---|---|---|
void |
addClientErrorInterceptor(ClientErrorInterceptor handler)
Add a ClientErrorInterceptor to this provider factory instance. |
|
void |
addClientExceptionMapper(Class<? extends ClientExceptionMapper<?>> providerClass)
|
|
void |
addClientExceptionMapper(ClientExceptionMapper<?> provider)
|
|
void |
addClientExceptionMapper(ClientExceptionMapper<?> provider,
Class<?> providerClass)
|
|
void |
addClientExceptionMapper(ClientExceptionMapper<?> provider,
Type exceptionType)
|
|
static Map<Class<?>,Object> |
addContextDataLevel()
|
|
protected void |
addContextResolver(Class<? extends ContextResolver> resolver,
boolean builtin)
|
|
protected void |
addContextResolver(ContextResolver provider)
|
|
protected void |
addContextResolver(ContextResolver provider,
boolean builtin)
|
|
protected void |
addContextResolver(ContextResolver provider,
Class providerClass,
boolean builtin)
|
|
protected void |
addContextResolver(ContextResolver provider,
Type typeParameter,
Class providerClass,
boolean builtin)
|
|
protected void |
addExceptionMapper(Class<? extends ExceptionMapper> providerClass)
|
|
protected void |
addExceptionMapper(ExceptionMapper provider)
|
|
protected void |
addExceptionMapper(ExceptionMapper provider,
Class providerClass)
|
|
protected void |
addExceptionMapper(ExceptionMapper provider,
Type exceptionType)
|
|
void |
addHeaderDelegate(Class clazz,
RuntimeDelegate.HeaderDelegate header)
|
|
protected void |
addMessageBodyReader(Class<? extends MessageBodyReader> provider,
boolean isBuiltin)
|
|
protected void |
addMessageBodyReader(MessageBodyReader provider)
|
|
protected void |
addMessageBodyReader(MessageBodyReader provider,
boolean isBuiltin)
|
|
protected void |
addMessageBodyReader(MessageBodyReader provider,
Class providerClass,
boolean isBuiltin)
Specify the provider class. |
|
protected void |
addMessageBodyWriter(Class<? extends MessageBodyWriter> provider,
boolean isBuiltin)
|
|
protected void |
addMessageBodyWriter(MessageBodyWriter provider)
|
|
protected void |
addMessageBodyWriter(MessageBodyWriter provider,
Class providerClass,
boolean isBuiltin)
Specify the provider class. |
|
protected void |
addStringConverter(Class<? extends StringConverter> resolver)
|
|
protected void |
addStringConverter(StringConverter provider)
|
|
protected void |
addStringConverter(StringConverter provider,
Class providerClass)
|
|
protected void |
addStringConverter(StringConverter provider,
Type typeParameter)
|
|
void |
addStringParameterUnmarshaller(Class<? extends StringParameterUnmarshaller> provider)
|
|
void |
appendInterceptorPrecedence(String precedence)
Append interceptor predence |
|
static void |
clearContextData()
|
|
static void |
clearInstanceIfEqual(ResteasyProviderFactory factory)
|
|
|
createConstructorInjector(Class<? extends T> clazz)
|
|
|
createEndpoint(Application applicationConfig,
Class<T> endpointType)
this is a spec method that is unsupported. |
|
|
createHeaderDelegate(Class<T> tClass)
Obtain an instance of a RuntimeDelegate.HeaderDelegate for the supplied class. |
|
|
createProviderInstance(Class<? extends T> clazz)
Create an instance of a class using provider allocation rules of the specification as well as the InjectorFactory only does constructor injection |
|
Response.ResponseBuilder |
createResponseBuilder()
Create a new instance of a Response.ResponseBuilder. |
|
|
createStringParameterUnmarshaller(Class<T> clazz)
|
|
UriBuilder |
createUriBuilder()
Create a new instance of a UriBuilder. |
|
Variant.VariantListBuilder |
createVariantListBuilder()
Create a new instance of a Variant.VariantListBuilder. |
|
Set<DynamicFeature> |
getClientDynamicFeatures()
|
|
List<ClientErrorInterceptor> |
getClientErrorInterceptors()
Return the list of currently registered ClientErrorInterceptor instances. |
|
|
getClientExceptionMapper(Class<T> type)
|
|
protected Map<Class<?>,ClientExceptionMapper> |
getClientExceptionMappers()
|
|
InterceptorRegistry<ClientExecutionInterceptor> |
getClientExecutionInterceptorRegistry()
|
|
ReaderInterceptorRegistry |
getClientReaderInterceptorRegistry()
|
|
JaxrsInterceptorRegistry<ClientRequestFilter> |
getClientRequestFilters()
|
|
JaxrsInterceptorRegistry<ClientResponseFilter> |
getClientResponseFilters()
|
|
WriterInterceptorRegistry |
getClientWriterInterceptorRegistry()
|
|
ContainerRequestFilterRegistry |
getContainerRequestFilterRegistry()
|
|
ContainerResponseFilterRegistry |
getContainerResponseFilterRegistry()
|
|
static
|
getContextData(Class<T> type)
|
|
static int |
getContextDataLevelCount()
|
|
static Map<Class<?>,Object> |
getContextDataMap()
|
|
|
getContextResolver(Class<T> contextType,
MediaType mediaType)
Get a context resolver for a particular type of context and media type. |
|
protected Map<Class<?>,MediaTypeMap<ResteasyProviderFactory.SortedKey<ContextResolver>>> |
getContextResolvers()
|
|
List<ContextResolver> |
getContextResolvers(Class<?> clazz,
MediaType type)
|
|
Collection<Feature> |
getEnabledFeatures()
Get the immutable set of features that have been successfully configured within the current configurable context. |
|
|
getExceptionMapper(Class<T> type)
Get an exception mapping provider for a particular class of exception. |
|
protected Map<Class<?>,ExceptionMapper> |
getExceptionMappers()
|
|
Set<Class<?>> |
getFeatureClasses()
Get the immutable set of registered feature classes to be instantiated, injected and Feature.configure(Configurable) configured}
in the scope of the configured instance. |
|
Set<Object> |
getFeatureInstances()
Get the immutable set of registered feature instances to be Feature.configure(Configurable) configured} in the scope
of the configured instance. |
|
protected Map<Class<?>,RuntimeDelegate.HeaderDelegate> |
getHeaderDelegates()
|
|
InjectorFactory |
getInjectorFactory()
|
|
static ResteasyProviderFactory |
getInstance()
Initializes ResteasyProviderFactory singleton if not set |
|
|
getMessageBodyReader(Class<T> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType)
Get a message body reader that matches a set of criteria. |
|
protected MediaTypeMap<ResteasyProviderFactory.SortedKey<MessageBodyReader>> |
getMessageBodyReaders()
|
|
|
getMessageBodyWriter(Class<T> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType)
Get a message body writer that matches a set of criteria. |
|
protected MediaTypeMap<ResteasyProviderFactory.SortedKey<MessageBodyWriter>> |
getMessageBodyWriters()
|
|
Map<String,Object> |
getMutableProperties()
|
|
ParamConverter |
getParamConverter(Class clazz,
Type genericType,
Annotation[] annotations)
|
|
protected List<ParamConverterProvider> |
getParamConverterProviders()
|
|
ResteasyProviderFactory |
getParent()
|
|
protected LegacyPrecedence |
getPrecedence()
|
|
Map<String,Object> |
getProperties()
Get the immutable bag of configuration properties. |
|
Object |
getProperty(String name)
Get the value for the property with a given name. |
|
Set<Class<?>> |
getProviderClasses()
Copy |
|
Set<Object> |
getProviderInstances()
Copy |
|
Set<DynamicFeature> |
getServerDynamicFeatures()
|
|
ReaderInterceptorRegistry |
getServerReaderInterceptorRegistry()
|
|
WriterInterceptorRegistry |
getServerWriterInterceptorRegistry()
|
|
StringConverter |
getStringConverter(Class<?> clazz)
|
|
protected Map<Class<?>,StringConverter> |
getStringConverters()
|
|
protected Map<Class<?>,Class<? extends StringParameterUnmarshaller>> |
getStringParameterUnmarshallers()
|
|
protected void |
initialize()
|
|
|
injectedInstance(Class<? extends T> clazz)
Property and constructor injection using the InjectorFactory |
|
void |
injectProperties(Class declaring,
Object obj)
|
|
void |
injectProperties(Object obj)
|
|
void |
insertInterceptorPrecedenceAfter(String after,
String newPrecedence)
|
|
void |
insertInterceptorPrecedenceBefore(String before,
String newPrecedence)
|
|
protected boolean |
isA(Class target,
Class type,
Class<?>[] contracts)
|
|
protected boolean |
isA(Object target,
Class type,
Class<?>[] contracts)
|
|
boolean |
isBuiltinsRegistered()
|
|
boolean |
isRegisterBuiltins()
|
|
static ResteasyProviderFactory |
peekInstance()
Will not initialize singleton if not set |
|
static
|
popContextData(Class<T> type)
|
|
static
|
pushContext(Class<T> type,
T data)
|
|
static void |
pushContextDataMap(Map<Class<?>,Object> map)
|
|
Configurable |
register(Class<?> providerClass)
Register a provider or a feature class to be instantiated
and used in the scope of the configured instance. |
|
Configurable |
register(Class<?> providerClass,
int bindingPriority)
Register a provider or a feature class to be instantiated and used
in the scope of the configured instance. |
|
|
register(Class<T> providerClass,
Class<? super T>... contracts)
Register a provider or a feature class to be instantiated
and used in the scope of the configured instance. |
|
|
register(Class<T> providerClass,
int bindingPriority,
Class<? super T>... contracts)
Register a provider or a feature class to be instantiated
and used in the scope of the configured instance. |
|
Configurable |
register(Object provider)
Register a provider or a feature ("singleton") instance to be used
in the scope of the configured instance. |
|
|
register(Object provider,
Class<? super T>... contracts)
Register a provider or a feature ("singleton") instance to be used
in the scope of the configured instance. |
|
Configurable |
register(Object provider,
int bindingPriority)
Register a provider or a feature ("singleton") instance to be used
in the scope of the configured instance. |
|
|
register(Object provider,
int bindingPriority,
Class<? super T>... contracts)
Register a provider or a feature ("singleton") instance to be used
in the scope of the configured instance. |
|
protected void |
registerDefaultInterceptorPrecedences()
|
|
protected void |
registerDefaultInterceptorPrecedences(InterceptorRegistry registry)
|
|
void |
registerProvider(Class provider)
|
|
void |
registerProvider(Class provider,
boolean isBuiltin)
Register a @Provider class. |
|
void |
registerProvider(Class provider,
boolean isBuiltin,
int bindingPriority,
Class<?>... contracts)
|
|
void |
registerProviderInstance(Object provider)
Register a @Provider object. |
|
void |
registerProviderInstance(Object provider,
int bindingPriority,
Class<?>... contracts)
|
|
static void |
removeContextDataLevel()
|
|
void |
setBuiltinsRegistered(boolean builtinsRegistered)
|
|
void |
setInjectorFactory(InjectorFactory injectorFactory)
|
|
static void |
setInstance(ResteasyProviderFactory factory)
|
|
Configurable |
setProperties(Map<String,?> properties)
Set new configuration properties replacing all previously set properties. |
|
Configurable |
setProperty(String name,
Object value)
Set the new configuration property, if already set, the existing value of the property will be updated. |
|
static void |
setRegisterBuiltinByDefault(boolean registerBuiltinByDefault)
|
|
void |
setRegisterBuiltins(boolean registerBuiltins)
|
|
String |
toHeaderString(Object object)
Convert an object to a header string. |
|
String |
toString(Object object,
Class clazz,
Type genericType,
Annotation[] annotations)
Convert an object to a string. |
|
| Methods inherited from class javax.ws.rs.ext.RuntimeDelegate |
|---|
setInstance |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static AtomicReference<ResteasyProviderFactory> pfr
protected static ThreadLocalStack<Map<Class<?>,Object>> contextualData
protected static int maxForwards
protected static volatile ResteasyProviderFactory instance
public static boolean registerBuiltinByDefault
protected MediaTypeMap<ResteasyProviderFactory.SortedKey<MessageBodyReader>> messageBodyReaders
protected MediaTypeMap<ResteasyProviderFactory.SortedKey<MessageBodyWriter>> messageBodyWriters
protected Map<Class<?>,ExceptionMapper> exceptionMappers
protected Map<Class<?>,ClientExceptionMapper> clientExceptionMappers
protected Map<Class<?>,MediaTypeMap<ResteasyProviderFactory.SortedKey<ContextResolver>>> contextResolvers
protected Map<Class<?>,StringConverter> stringConverters
protected List<ParamConverterProvider> paramConverterProviders
protected Map<Class<?>,Class<? extends StringParameterUnmarshaller>> stringParameterUnmarshallers
protected Map<Class<?>,RuntimeDelegate.HeaderDelegate> headerDelegates
protected LegacyPrecedence precedence
protected ReaderInterceptorRegistry serverReaderInterceptorRegistry
protected WriterInterceptorRegistry serverWriterInterceptorRegistry
protected ContainerRequestFilterRegistry containerRequestFilterRegistry
protected ContainerResponseFilterRegistry containerResponseFilterRegistry
protected JaxrsInterceptorRegistry<ClientRequestFilter> clientRequestFilters
protected JaxrsInterceptorRegistry<ClientResponseFilter> clientResponseFilters
protected ReaderInterceptorRegistry clientReaderInterceptorRegistry
protected WriterInterceptorRegistry clientWriterInterceptorRegistry
protected InterceptorRegistry<ClientExecutionInterceptor> clientExecutionInterceptorRegistry
protected List<ClientErrorInterceptor> clientErrorInterceptors
protected boolean builtinsRegistered
protected boolean registerBuiltins
protected InjectorFactory injectorFactory
protected ResteasyProviderFactory parent
protected Set<DynamicFeature> serverDynamicFeatures
protected Set<DynamicFeature> clientDynamicFeatures
protected Set<Feature> enabledFeatures
protected Map<String,Object> properties
protected Set<Class<?>> providerClasses
protected Set<Object> providerInstances
protected Set<Class<?>> featureClasses
protected Set<Object> featureInstances
| Constructor Detail |
|---|
public ResteasyProviderFactory()
public ResteasyProviderFactory(ResteasyProviderFactory parent)
parent - | Method Detail |
|---|
protected void initialize()
public Set<DynamicFeature> getServerDynamicFeatures()
public Set<DynamicFeature> getClientDynamicFeatures()
protected MediaTypeMap<ResteasyProviderFactory.SortedKey<MessageBodyReader>> getMessageBodyReaders()
protected MediaTypeMap<ResteasyProviderFactory.SortedKey<MessageBodyWriter>> getMessageBodyWriters()
protected Map<Class<?>,ExceptionMapper> getExceptionMappers()
protected Map<Class<?>,ClientExceptionMapper> getClientExceptionMappers()
protected Map<Class<?>,MediaTypeMap<ResteasyProviderFactory.SortedKey<ContextResolver>>> getContextResolvers()
protected Map<Class<?>,StringConverter> getStringConverters()
protected List<ParamConverterProvider> getParamConverterProviders()
protected Map<Class<?>,Class<? extends StringParameterUnmarshaller>> getStringParameterUnmarshallers()
public Set<Class<?>> getProviderClasses()
getProviderClasses in interface ConfigurableConfigurable.getProviderInstances()public Set<Object> getProviderInstances()
getProviderInstances in interface ConfigurableConfigurable.getProviderClasses()protected LegacyPrecedence getPrecedence()
public ResteasyProviderFactory getParent()
protected void registerDefaultInterceptorPrecedences(InterceptorRegistry registry)
protected void registerDefaultInterceptorPrecedences()
public void appendInterceptorPrecedence(String precedence)
precedence -
public void insertInterceptorPrecedenceAfter(String after,
String newPrecedence)
after - put newPrecedence after thisnewPrecedence -
public void insertInterceptorPrecedenceBefore(String before,
String newPrecedence)
before - put newPrecedence before thisnewPrecedence -
public static <T> void pushContext(Class<T> type,
T data)
public static void pushContextDataMap(Map<Class<?>,Object> map)
public static Map<Class<?>,Object> getContextDataMap()
public static <T> T getContextData(Class<T> type)
public static <T> T popContextData(Class<T> type)
public static void clearContextData()
public static Map<Class<?>,Object> addContextDataLevel()
public static int getContextDataLevelCount()
public static void removeContextDataLevel()
public static ResteasyProviderFactory peekInstance()
public static void clearInstanceIfEqual(ResteasyProviderFactory factory)
public static void setInstance(ResteasyProviderFactory factory)
public static ResteasyProviderFactory getInstance()
public static void setRegisterBuiltinByDefault(boolean registerBuiltinByDefault)
public boolean isRegisterBuiltins()
public void setRegisterBuiltins(boolean registerBuiltins)
public InjectorFactory getInjectorFactory()
public void setInjectorFactory(InjectorFactory injectorFactory)
public InterceptorRegistry<ClientExecutionInterceptor> getClientExecutionInterceptorRegistry()
public ReaderInterceptorRegistry getServerReaderInterceptorRegistry()
public WriterInterceptorRegistry getServerWriterInterceptorRegistry()
public ContainerRequestFilterRegistry getContainerRequestFilterRegistry()
public ContainerResponseFilterRegistry getContainerResponseFilterRegistry()
public ReaderInterceptorRegistry getClientReaderInterceptorRegistry()
public WriterInterceptorRegistry getClientWriterInterceptorRegistry()
public JaxrsInterceptorRegistry<ClientRequestFilter> getClientRequestFilters()
public JaxrsInterceptorRegistry<ClientResponseFilter> getClientResponseFilters()
public boolean isBuiltinsRegistered()
public void setBuiltinsRegistered(boolean builtinsRegistered)
public UriBuilder createUriBuilder()
RuntimeDelegateUriBuilder.
createUriBuilder in class RuntimeDelegateUriBuilder instance.UriBuilderpublic Response.ResponseBuilder createResponseBuilder()
RuntimeDelegateResponse.ResponseBuilder.
createResponseBuilder in class RuntimeDelegateResponseBuilder instance.Response.ResponseBuilderpublic Variant.VariantListBuilder createVariantListBuilder()
RuntimeDelegateVariant.VariantListBuilder.
createVariantListBuilder in class RuntimeDelegateVariantListBuilder instance.Variant.VariantListBuilderpublic <T> RuntimeDelegate.HeaderDelegate<T> createHeaderDelegate(Class<T> tClass)
RuntimeDelegateRuntimeDelegate.HeaderDelegate for the supplied class. An
implementation is required to support the following values for type:
CacheControl, Cookie,
EntityTag, Link,
NewCookie, MediaType
and java.util.Date.
createHeaderDelegate in class RuntimeDelegateT - header type.tClass - the class of the header.
HeaderDelegate for the supplied type.RuntimeDelegate.HeaderDelegateprotected Map<Class<?>,RuntimeDelegate.HeaderDelegate> getHeaderDelegates()
public void addHeaderDelegate(Class clazz,
RuntimeDelegate.HeaderDelegate header)
protected void addMessageBodyReader(Class<? extends MessageBodyReader> provider,
boolean isBuiltin)
protected void addMessageBodyReader(MessageBodyReader provider)
protected void addMessageBodyReader(MessageBodyReader provider,
boolean isBuiltin)
protected void addMessageBodyReader(MessageBodyReader provider,
Class providerClass,
boolean isBuiltin)
provider - providerClass - isBuiltin -
protected void addMessageBodyWriter(Class<? extends MessageBodyWriter> provider,
boolean isBuiltin)
protected void addMessageBodyWriter(MessageBodyWriter provider)
protected void addMessageBodyWriter(MessageBodyWriter provider,
Class providerClass,
boolean isBuiltin)
provider - providerClass - isBuiltin -
public <T> MessageBodyReader<T> getMessageBodyReader(Class<T> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType)
ProvidersmediaType with the value of each reader's
Consumes, ensuring the supplied value of
type is assignable to the generic type of the reader, and
eliminating those that do not match.
The list of matching readers is then ordered with those with the best
matching values of Consumes (x/y > x/* > */*)
sorted first. Finally, the
MessageBodyReader.isReadable(Class, Type, Annotation[], MediaType)
method is called on each reader in order using the supplied criteria and
the first reader that returns true is selected and returned.
getMessageBodyReader in interface ProvidersT - type of the the object that is to be read.type - the class of the object that is to be read.genericType - the type of object to be produced. E.g. if the
message body is to be converted into a method parameter, this will be
the formal type of the method parameter as returned by
Class.getGenericParameterTypes.annotations - an array of the annotations on the declaration of the
artifact that will be initialized with the produced instance. E.g. if
the message body is to be converted into a method parameter, this will
be the annotations on that parameter returned by
Class.getParameterAnnotations.mediaType - the media type of the data that will be read.
null
if none is found.protected void addExceptionMapper(Class<? extends ExceptionMapper> providerClass)
protected void addExceptionMapper(ExceptionMapper provider)
protected void addExceptionMapper(ExceptionMapper provider,
Class providerClass)
protected void addExceptionMapper(ExceptionMapper provider,
Type exceptionType)
public void addClientExceptionMapper(Class<? extends ClientExceptionMapper<?>> providerClass)
public void addClientExceptionMapper(ClientExceptionMapper<?> provider)
public void addClientExceptionMapper(ClientExceptionMapper<?> provider,
Class<?> providerClass)
public void addClientExceptionMapper(ClientExceptionMapper<?> provider,
Type exceptionType)
public void addClientErrorInterceptor(ClientErrorInterceptor handler)
ClientErrorInterceptor to this provider factory instance.
Duplicate handlers are ignored. (For Client Proxy API only)
public List<ClientErrorInterceptor> getClientErrorInterceptors()
ClientErrorInterceptor instances.
protected void addContextResolver(Class<? extends ContextResolver> resolver,
boolean builtin)
protected void addContextResolver(ContextResolver provider)
protected void addContextResolver(ContextResolver provider,
boolean builtin)
protected void addContextResolver(ContextResolver provider,
Class providerClass,
boolean builtin)
protected void addContextResolver(ContextResolver provider,
Type typeParameter,
Class providerClass,
boolean builtin)
protected void addStringConverter(Class<? extends StringConverter> resolver)
protected void addStringConverter(StringConverter provider)
protected void addStringConverter(StringConverter provider,
Class providerClass)
protected void addStringConverter(StringConverter provider,
Type typeParameter)
public void addStringParameterUnmarshaller(Class<? extends StringParameterUnmarshaller> provider)
public List<ContextResolver> getContextResolvers(Class<?> clazz,
MediaType type)
public ParamConverter getParamConverter(Class clazz,
Type genericType,
Annotation[] annotations)
public StringConverter getStringConverter(Class<?> clazz)
public <T> StringParameterUnmarshaller<T> createStringParameterUnmarshaller(Class<T> clazz)
public void registerProvider(Class provider)
public String toString(Object object,
Class clazz,
Type genericType,
Annotation[] annotations)
object -
public String toHeaderString(Object object)
HeaderValueProcessor
toHeaderString in interface HeaderValueProcessor
public void registerProvider(Class provider,
boolean isBuiltin)
provider -
protected boolean isA(Class target,
Class type,
Class<?>[] contracts)
protected boolean isA(Object target,
Class type,
Class<?>[] contracts)
public void registerProvider(Class provider,
boolean isBuiltin,
int bindingPriority,
Class<?>... contracts)
public void registerProviderInstance(Object provider)
provider -
public void registerProviderInstance(Object provider,
int bindingPriority,
Class<?>... contracts)
public <T extends Throwable> ExceptionMapper<T> getExceptionMapper(Class<T> type)
Providerstype.
getExceptionMapper in interface ProvidersT - type of the exception handled by the exception mapping provider.type - the class of exception.
ExceptionMapper for the supplied type or null
if none is found.public <T extends Throwable> ClientExceptionMapper<T> getClientExceptionMapper(Class<T> type)
public <T> MessageBodyWriter<T> getMessageBodyWriter(Class<T> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType)
ProvidersmediaType with the value of each writer's
Produces, ensuring the supplied value of
type is assignable to the generic type of the reader, and
eliminating those that do not match.
The list of matching writers is then ordered with those with the best
matching values of Produces (x/y > x/* > */*)
sorted first. Finally, the
MessageBodyWriter.isWriteable(Class, Type, Annotation[], MediaType)
method is called on each writer in order using the supplied criteria and
the first writer that returns true is selected and returned.
getMessageBodyWriter in interface ProvidersT - type of the object that is to be written.type - the class of the object that is to be written.genericType - the type of object to be written. E.g. if the
message body is to be produced from a field, this will be
the declared type of the field as returned by Field.getGenericType.annotations - an array of the annotations on the declaration of the
artifact that will be written. E.g. if the
message body is to be produced from a field, this will be
the annotations on that field returned by
Field.getDeclaredAnnotations.mediaType - the media type of the data that will be written.
null
if none is found.
public <T> T createEndpoint(Application applicationConfig,
Class<T> endpointType)
throws IllegalArgumentException,
UnsupportedOperationException
createEndpoint in class RuntimeDelegateT - endpoint type.applicationConfig - endpointType -
IllegalArgumentException
UnsupportedOperationException
public <T> ContextResolver<T> getContextResolver(Class<T> contextType,
MediaType mediaType)
ProvidersmediaType with the value of each resolver's
Produces, ensuring the generic type of the context
resolver is assignable to the supplied value of contextType, and
eliminating those that do not match. If only one resolver matches the
criteria then it is returned. If more than one resolver matches then the
list of matching resolvers is ordered with those with the best
matching values of Produces (x/y > x/* > */*)
sorted first. A proxy is returned that delegates calls to
ContextResolver.getContext(java.lang.Class) to each matching context
resolver in order and returns the first non-null value it obtains or null
if all matching context resolvers return null.
getContextResolver in interface ProvidersT - type of the context.contextType - the class of context desired.mediaType - the media type of data for which a context is required.
null if no matching
context providers are found.public <T> T createProviderInstance(Class<? extends T> clazz)
T - clazz -
public <T> ConstructorInjector createConstructorInjector(Class<? extends T> clazz)
public <T> T injectedInstance(Class<? extends T> clazz)
T - clazz -
public void injectProperties(Class declaring,
Object obj)
public void injectProperties(Object obj)
public Map<String,Object> getMutableProperties()
public Map<String,Object> getProperties()
Configurable
getProperties in interface Configurablepublic Object getProperty(String name)
Configurable
getProperty in interface Configurablename - property name.
null
if the property with such name is not configured.public Configurable setProperties(Map<String,?> properties)
Configurable
setProperties in interface Configurableproperties - new set of configuration properties. The content of
the map will replace any existing properties set on the configurable
instance.
public Configurable setProperty(String name,
Object value)
Configurablenull value into a property
effectively removes the property from the property bag.
setProperty in interface Configurablename - property name.value - (new) property value. null value removes the property
with the given name.
public Collection<Feature> getEnabledFeatures()
Configurable
The returned set contains the features that have already been successfully
configured in this configuration context.
Note that a registered features may not be immediately available in the collection
of enabled features returned this method. Implementations MAY decide to defer the feature
instantiation and/or configuration to a later point
in time, yet the order in which features have been registered MUST be preserved during
the feature configuration phase. This method is expected to provide up-to-date information only
when invoked from a feature configuration method or
once the configured instance has been fully initialized.
getEnabledFeatures in interface Configurablenull.public Set<Class<?>> getFeatureClasses()
ConfigurableFeature.configure(Configurable) configured}
in the scope of the configured instance.
getFeatureClasses in interface Configurablenull.Configurable.getFeatureInstances()public Set<Object> getFeatureInstances()
ConfigurableFeature.configure(Configurable) configured} in the scope
of the configured instance.
When the configured instance is initialized the set of feature instances will be combined with and take precedence over the instantiated registered feature classes.
getFeatureInstances in interface Configurablenull.Configurable.getFeatureClasses()public Configurable register(Class<?> providerClass)
Configurablefeature class to be instantiated
and used in the scope of the configured instance.
The registered class is registered as a provider of all the recognized JAX-RS or
implementation-specific extension contracts including Feature contract.
As opposed to the instances registered via Configurable.register(Object) method, classes
registered using this method are instantiated and properly injected
by the JAX-RS implementation provider. In case of a conflict between
a registered feature and/or provider instance and instantiated registered class,
the registered instance takes precedence and the registered class will not be
instantiated in such case.
register in interface ConfigurableproviderClass - provider class to be instantiated and used in the scope
of the configured instance.
public Configurable register(Class<?> providerClass,
int bindingPriority)
Configurablefeature class to be instantiated and used
in the scope of the configured instance.
This registration method provides same functionality as Configurable.register(Class)
except that any provider binding priority specified on the provider class using
@BindingPriority annotation is overridden
with the supplied bindingPriority value.
Note that in case the binding priority is not applicable to any particular provider
contract registered for the provider class, the supplied bindingPriority value
will be ignored for that contract.
register in interface ConfigurableproviderClass - provider class to be instantiated and used in the scope
of the configured instance.bindingPriority - the overriding binding priority for the registered contract(s).
public <T> Configurable register(Class<T> providerClass,
Class<? super T>... contracts)
Configurablefeature class to be instantiated
and used in the scope of the configured instance.
This registration method provides same functionality as Configurable.register(Class)
except the provider class is only registered as a provider of the listed
contracts. Note that in case the Feature interface is not listed
explicitly, the provider class is not recognized as a JAX-RS feature.
register in interface ConfigurableproviderClass - provider class to be instantiated and used in the scope
of the configured instance.contracts - the specific set of contracts implemented by the provider class
for which the provider should be registered. If omitted, the
provider class will be registered as a provider of all recognized
contracts implemented by the provider class.
public <T> Configurable register(Class<T> providerClass,
int bindingPriority,
Class<? super T>... contracts)
Configurablefeature class to be instantiated
and used in the scope of the configured instance.
This registration method provides same functionality as Configurable.register(Class, Class[])
except that any provider binding priority specified on the provider class using
@BindingPriority annotation is overridden
with the supplied bindingPriority value.
Note that in case the binding priority is not applicable to any particular provider
contract registered for the provider class, the supplied bindingPriority value
will be ignored for that contract.
register in interface ConfigurableproviderClass - provider class to be instantiated and used in the scope
of the configured instance.bindingPriority - the overriding binding priority for the registered contract(s).contracts - the specific set of contracts implemented by the provider class
for which the provider should be registered. If omitted, the
provider class will be registered as a provider of all recognized
contracts implemented by the provider class.
public Configurable register(Object provider)
Configurablefeature ("singleton") instance to be used
in the scope of the configured instance.
The registered instance is registered as a provider of all the recognized JAX-RS or
implementation-specific extension contracts including Feature contract.
As opposed to the instances registered via Configurable.register(Object) method, classes
registered using this method used "as is", i.e. are not managed or
injected by the JAX-RS implementation provider. In case of a conflict between
a registered feature and/or provider instance and instantiated registered class,
the registered instance takes precedence and the registered class will not be
instantiated in such case.
register in interface Configurableprovider - a provider instance to be registered in the scope of the configured
instance.
public Configurable register(Object provider,
int bindingPriority)
Configurablefeature ("singleton") instance to be used
in the scope of the configured instance.
This registration method provides same functionality as Configurable.register(Object)
except that any provider binding priority specified on the provider using
@BindingPriority annotation is overridden
with the supplied bindingPriority value.
Note that in case the binding priority is not applicable to any particular provider
contract registered for the provider, the supplied bindingPriority value
will be ignored for that contract.
register in interface Configurableprovider - provider class to be instantiated and used in the scope
of the configured instance.bindingPriority - the overriding binding priority for the registered contract(s).
public <T> Configurable register(Object provider,
Class<? super T>... contracts)
Configurablefeature ("singleton") instance to be used
in the scope of the configured instance.
This registration method provides same functionality as Configurable.register(Object)
except the provider is only registered as a provider of the listed
contracts. Note that in case the Feature interface is not listed
explicitly, the provider is not recognized as a JAX-RS feature.
register in interface Configurableprovider - a provider instance to be registered in the scope of the configured
instance.contracts - the specific set of contracts implemented by the provider class
for which the provider should be registered. If omitted, the
provider class will be registered as a provider of all recognized
contracts implemented by the provider class.
public <T> Configurable register(Object provider,
int bindingPriority,
Class<? super T>... contracts)
Configurablefeature ("singleton") instance to be used
in the scope of the configured instance.
This registration method provides same functionality as Configurable.register(Object, Class[])
except that any provider binding priority specified on the provider using
@BindingPriority annotation is overridden
with the supplied bindingPriority value.
Note that in case the binding priority is not applicable to any particular provider
contract registered for the provider, the supplied bindingPriority value
will be ignored for that contract.
register in interface Configurableprovider - a provider instance to be registered in the scope of the configured
instance.bindingPriority - the overriding binding priority for the registered contract(s).contracts - the specific set of contracts implemented by the provider class
for which the provider should be registered. If omitted, the
provider class will be registered as a provider of all recognized
contracts implemented by the provider class.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||