Apache CXF API

org.apache.cxf.jaxrs.provider
Class ProviderFactory

java.lang.Object
  extended by org.apache.cxf.jaxrs.provider.ProviderFactory
Direct Known Subclasses:
ClientProviderFactory, ServerProviderFactory

public abstract class ProviderFactory
extends Object


Nested Class Summary
protected static class ProviderFactory.AbstractPriorityComparator
           
protected static class ProviderFactory.BindingPriorityComparator
           
static class ProviderFactory.ClassComparator
           
protected static class ProviderFactory.NameKey
           
protected static class ProviderFactory.NameKeyComparator
           
protected static class ProviderFactory.NameKeyMap<T>
           
 
Field Summary
protected static String CLIENT_FACTORY_NAME
           
static String DEFAULT_FILTER_NAME_BINDING
           
protected static String IGNORE_TYPE_VARIABLES
           
static String PROVIDER_SELECTION_PROPERTY_CHANGED
           
protected  Map<ProviderFactory.NameKey,ProviderInfo<javax.ws.rs.ext.ReaderInterceptor>> readerInterceptors
           
protected static String SERVER_FACTORY_NAME
           
protected  Map<ProviderFactory.NameKey,ProviderInfo<javax.ws.rs.ext.WriterInterceptor>> writerInterceptors
           
 
Constructor Summary
protected ProviderFactory(ProviderFactory baseFactory, Bus bus)
           
 
Method Summary
protected  void addProviderToList(List<?> list, ProviderInfo<?> provider)
           
 void clearProviders()
           
 void clearThreadLocalProxies()
           
protected static int compareClasses(Class<?> expectedCls, Object o1, Object o2)
           
protected static int compareClasses(Object o1, Object o2)
           
<T> ContextProvider<T>
createContextProvider(Type contextType, Message m)
           
<T> javax.ws.rs.ext.ContextResolver<T>
createContextResolver(Type contextType, Message m)
           
<T> javax.ws.rs.ext.ContextResolver<T>
createContextResolver(Type contextType, Message m, javax.ws.rs.core.MediaType type)
           
<T> javax.ws.rs.ext.MessageBodyReader<T>
createMessageBodyReader(Class<T> bodyType, Type parameterType, Annotation[] parameterAnnotations, javax.ws.rs.core.MediaType mediaType, Message m)
           
<T> List<javax.ws.rs.ext.ReaderInterceptor>
createMessageBodyReaderInterceptor(Class<T> bodyType, Type parameterType, Annotation[] parameterAnnotations, javax.ws.rs.core.MediaType mediaType, Message m, boolean checkMbrNow, Set<String> names)
           
<T> javax.ws.rs.ext.MessageBodyWriter<T>
createMessageBodyWriter(Class<T> bodyType, Type parameterType, Annotation[] parameterAnnotations, javax.ws.rs.core.MediaType mediaType, Message m)
           
<T> List<javax.ws.rs.ext.WriterInterceptor>
createMessageBodyWriterInterceptor(Class<T> bodyType, Type parameterType, Annotation[] parameterAnnotations, javax.ws.rs.core.MediaType mediaType, Message m, Set<String> names)
           
<T> javax.ws.rs.ext.ParamConverter<T>
createParameterHandler(Class<T> paramType, Annotation[] anns)
           
protected static Object createProvider(String className)
           
protected  ProviderInfo<? extends Object> createProviderFromConstructor(Constructor<?> c, Map<Class<?>,Object> values)
           
protected static boolean filterContractSupported(ProviderInfo<?> provider, Class<?> providerCls, Class<?> contract)
           
protected  ProviderFactory getBaseFactory()
           
protected static
<T> List<ProviderInfo<T>>
getBoundFilters(Map<ProviderFactory.NameKey,ProviderInfo<T>> boundFilters, Set<String> names)
           
 Bus getBus()
           
 javax.ws.rs.core.Configuration getDynamicConfiguration()
           
protected static Set<String> getFilterNameBindings(ProviderInfo<?> p)
           
protected static int getFilterPriority(ProviderInfo<?> p, Class<?> providerCls)
           
static ProviderFactory getInstance(Message m)
           
 javax.ws.rs.ext.MessageBodyWriter<?> getRegisteredJaxbWriter()
           
protected
<T> void
handleMapper(List<T> candidates, ProviderInfo<T> em, Class<?> expectedType, Message m, Class<?> providerClass, boolean injectContext)
           
protected static void initBaseFactory(ProviderFactory factory)
           
 void initProviders(List<ClassResourceInfo> cris)
           
protected  void injectContextProxies(Collection<?>... providerLists)
           
protected  void injectContextProxiesIntoProvider(ProviderInfo<?> pi)
           
protected  void injectContextValues(ProviderInfo<?> pi, Message m)
           
protected  boolean isBaseFactory()
           
protected static
<T> void
mapInterceptorFilters(Map<ProviderFactory.NameKey,ProviderInfo<T>> map, List<ProviderInfo<T>> filters, Class<?> providerCls, boolean ascending)
           
protected  List<ProviderInfo<? extends Object>> prepareProviders(Object[] providers, ProviderInfo<javax.ws.rs.core.Application> application)
           
 void registerUserProvider(Object provider)
           
 void setBus(Bus bus)
           
protected  void setBusProviders()
           
protected  void setCommonProviders(List<ProviderInfo<? extends Object>> theProviders)
           
 void setDynamicConfiguration(javax.ws.rs.core.Configuration config)
           
protected abstract  void setProviders(Object... providers)
           
 void setSchemaLocations(List<String> schemas)
           
 void setUserProviders(List<?> userProviders)
          Use for injection of entityProviders
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FILTER_NAME_BINDING

public static final String DEFAULT_FILTER_NAME_BINDING
See Also:
Constant Field Values

PROVIDER_SELECTION_PROPERTY_CHANGED

public static final String PROVIDER_SELECTION_PROPERTY_CHANGED
See Also:
Constant Field Values

SERVER_FACTORY_NAME

protected static final String SERVER_FACTORY_NAME
See Also:
Constant Field Values

CLIENT_FACTORY_NAME

protected static final String CLIENT_FACTORY_NAME
See Also:
Constant Field Values

IGNORE_TYPE_VARIABLES

protected static final String IGNORE_TYPE_VARIABLES
See Also:
Constant Field Values

readerInterceptors

protected Map<ProviderFactory.NameKey,ProviderInfo<javax.ws.rs.ext.ReaderInterceptor>> readerInterceptors

writerInterceptors

protected Map<ProviderFactory.NameKey,ProviderInfo<javax.ws.rs.ext.WriterInterceptor>> writerInterceptors
Constructor Detail

ProviderFactory

protected ProviderFactory(ProviderFactory baseFactory,
                          Bus bus)
Method Detail

getBus

public Bus getBus()

getBaseFactory

protected ProviderFactory getBaseFactory()

isBaseFactory

protected boolean isBaseFactory()

initBaseFactory

protected static void initBaseFactory(ProviderFactory factory)

createProvider

protected static Object createProvider(String className)

setDynamicConfiguration

public void setDynamicConfiguration(javax.ws.rs.core.Configuration config)

getDynamicConfiguration

public javax.ws.rs.core.Configuration getDynamicConfiguration()

createContextResolver

public <T> javax.ws.rs.ext.ContextResolver<T> createContextResolver(Type contextType,
                                                                    Message m)

createContextResolver

public <T> javax.ws.rs.ext.ContextResolver<T> createContextResolver(Type contextType,
                                                                    Message m,
                                                                    javax.ws.rs.core.MediaType type)

createContextProvider

public <T> ContextProvider<T> createContextProvider(Type contextType,
                                                    Message m)

createParameterHandler

public <T> javax.ws.rs.ext.ParamConverter<T> createParameterHandler(Class<T> paramType,
                                                                    Annotation[] anns)

handleMapper

protected <T> void handleMapper(List<T> candidates,
                                ProviderInfo<T> em,
                                Class<?> expectedType,
                                Message m,
                                Class<?> providerClass,
                                boolean injectContext)

createMessageBodyReaderInterceptor

public <T> List<javax.ws.rs.ext.ReaderInterceptor> createMessageBodyReaderInterceptor(Class<T> bodyType,
                                                                                      Type parameterType,
                                                                                      Annotation[] parameterAnnotations,
                                                                                      javax.ws.rs.core.MediaType mediaType,
                                                                                      Message m,
                                                                                      boolean checkMbrNow,
                                                                                      Set<String> names)

createMessageBodyWriterInterceptor

public <T> List<javax.ws.rs.ext.WriterInterceptor> createMessageBodyWriterInterceptor(Class<T> bodyType,
                                                                                      Type parameterType,
                                                                                      Annotation[] parameterAnnotations,
                                                                                      javax.ws.rs.core.MediaType mediaType,
                                                                                      Message m,
                                                                                      Set<String> names)

createMessageBodyReader

public <T> javax.ws.rs.ext.MessageBodyReader<T> createMessageBodyReader(Class<T> bodyType,
                                                                        Type parameterType,
                                                                        Annotation[] parameterAnnotations,
                                                                        javax.ws.rs.core.MediaType mediaType,
                                                                        Message m)

createMessageBodyWriter

public <T> javax.ws.rs.ext.MessageBodyWriter<T> createMessageBodyWriter(Class<T> bodyType,
                                                                        Type parameterType,
                                                                        Annotation[] parameterAnnotations,
                                                                        javax.ws.rs.core.MediaType mediaType,
                                                                        Message m)

setBusProviders

protected void setBusProviders()

setProviders

protected abstract void setProviders(Object... providers)

setCommonProviders

protected void setCommonProviders(List<ProviderInfo<? extends Object>> theProviders)

injectContextValues

protected void injectContextValues(ProviderInfo<?> pi,
                                   Message m)

addProviderToList

protected void addProviderToList(List<?> list,
                                 ProviderInfo<?> provider)

injectContextProxies

protected void injectContextProxies(Collection<?>... providerLists)

injectContextProxiesIntoProvider

protected void injectContextProxiesIntoProvider(ProviderInfo<?> pi)

registerUserProvider

public void registerUserProvider(Object provider)

setUserProviders

public void setUserProviders(List<?> userProviders)
Use for injection of entityProviders

Parameters:
entityProviders - the entityProviders to set

clearThreadLocalProxies

public void clearThreadLocalProxies()

clearProviders

public void clearProviders()

setBus

public void setBus(Bus bus)

setSchemaLocations

public void setSchemaLocations(List<String> schemas)

getBoundFilters

protected static <T> List<ProviderInfo<T>> getBoundFilters(Map<ProviderFactory.NameKey,ProviderInfo<T>> boundFilters,
                                                           Set<String> names)

initProviders

public void initProviders(List<ClassResourceInfo> cris)

getInstance

public static ProviderFactory getInstance(Message m)

compareClasses

protected static int compareClasses(Object o1,
                                    Object o2)

compareClasses

protected static int compareClasses(Class<?> expectedCls,
                                    Object o1,
                                    Object o2)

createProviderFromConstructor

protected ProviderInfo<? extends Object> createProviderFromConstructor(Constructor<?> c,
                                                                       Map<Class<?>,Object> values)

mapInterceptorFilters

protected static <T> void mapInterceptorFilters(Map<ProviderFactory.NameKey,ProviderInfo<T>> map,
                                                List<ProviderInfo<T>> filters,
                                                Class<?> providerCls,
                                                boolean ascending)

getFilterNameBindings

protected static Set<String> getFilterNameBindings(ProviderInfo<?> p)

getFilterPriority

protected static int getFilterPriority(ProviderInfo<?> p,
                                       Class<?> providerCls)

filterContractSupported

protected static boolean filterContractSupported(ProviderInfo<?> provider,
                                                 Class<?> providerCls,
                                                 Class<?> contract)

prepareProviders

protected List<ProviderInfo<? extends Object>> prepareProviders(Object[] providers,
                                                                ProviderInfo<javax.ws.rs.core.Application> application)

getRegisteredJaxbWriter

public javax.ws.rs.ext.MessageBodyWriter<?> getRegisteredJaxbWriter()

Apache CXF API

Apache CXF