|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.resteasy.plugins.spring.SpringBeanProcessor
public class SpringBeanProcessor
The processor will register any bean annotated with @Path or @Provider into the Resteasy framework.
It also sets up Registry and ResteasyProviderFactory to be autowirable via @Autowire in Controllers/service layers.
There's quite a bit of spring integration functionality under the covers:
This class takes advantaage of quite a few Spring
Nested Class Summary | |
---|---|
protected class |
SpringBeanProcessor.ResteasyBeanPostProcessor
|
Field Summary | |
---|---|
protected Dispatcher |
dispatcher
|
protected ResteasyProviderFactory |
providerFactory
|
protected Set<String> |
providerNames
|
protected Registry |
registry
|
protected Map<String,SpringResourceFactory> |
resourceFactories
|
Fields inherited from interface org.springframework.core.Ordered |
---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Constructor Summary | |
---|---|
SpringBeanProcessor()
|
|
SpringBeanProcessor(Dispatcher dispatcher)
|
|
SpringBeanProcessor(Dispatcher dispatcher,
Registry registry,
ResteasyProviderFactory providerFactory)
|
Method Summary | |
---|---|
Dispatcher |
getDispatcher()
|
int |
getOrder()
|
ResteasyProviderFactory |
getProviderFactory()
|
Registry |
getRegistry()
|
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event)
Register all of the resources into RESTEasy only when Spring finishes it's life-cycle and the spring singleton bean creation is completed |
void |
postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
This method keeps track of @Provider and resources for future use. |
protected Class<?> |
processBean(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory,
List<String> dependsOnProviders,
String name,
org.springframework.beans.factory.config.BeanDefinition beanDef)
process a single @Provider or a single resource. |
void |
setDispatcher(Dispatcher dispatcher)
|
void |
setOrder(int order)
|
void |
setProviderFactory(ResteasyProviderFactory providerFactory)
|
void |
setRegistry(Registry registry)
|
boolean |
supportsEventType(Class<? extends org.springframework.context.ApplicationEvent> eventType)
|
boolean |
supportsSourceType(Class<?> sourceType)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Registry registry
protected ResteasyProviderFactory providerFactory
protected Dispatcher dispatcher
protected Map<String,SpringResourceFactory> resourceFactories
protected Set<String> providerNames
Constructor Detail |
---|
public SpringBeanProcessor(Dispatcher dispatcher)
public SpringBeanProcessor(Dispatcher dispatcher, Registry registry, ResteasyProviderFactory providerFactory)
public SpringBeanProcessor()
Method Detail |
---|
public Registry getRegistry()
public void setRegistry(Registry registry)
public ResteasyProviderFactory getProviderFactory()
public void setProviderFactory(ResteasyProviderFactory providerFactory)
public Dispatcher getDispatcher()
public void setDispatcher(Dispatcher dispatcher)
public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) throws org.springframework.beans.BeansException
This method keeps track of @Provider and resources for future use. It also registers the RESTEasy Registry, ProviderFactry, and Dispatcher for @Autowire injection.
Beyond tracking, this will ensure that non-MessageBody(Reader|Writer) @Providers are created by Spring before any resources by having the resources "depends-on" the @Providers.
postProcessBeanFactory
in interface org.springframework.beans.factory.config.BeanFactoryPostProcessor
org.springframework.beans.BeansException
protected Class<?> processBean(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory, List<String> dependsOnProviders, String name, org.springframework.beans.factory.config.BeanDefinition beanDef)
public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener
public int getOrder()
getOrder
in interface org.springframework.core.Ordered
public void setOrder(int order)
public boolean supportsEventType(Class<? extends org.springframework.context.ApplicationEvent> eventType)
supportsEventType
in interface org.springframework.context.event.SmartApplicationListener
public boolean supportsSourceType(Class<?> sourceType)
supportsSourceType
in interface org.springframework.context.event.SmartApplicationListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |