public abstract class AbstractTypeAwareSupport<T>
extends java.lang.Object
implements org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>, org.springframework.beans.factory.InitializingBean
ApplicationContext.| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
AbstractTypeAwareSupport.BeansOfTypeTargetSource
TargetSource implementation that returns all beans of the configured type from the
ListableBeanFactory the instance was set up with. |
| Modifier and Type | Field and Description |
|---|---|
private org.springframework.context.ApplicationContext |
context |
private java.util.Collection<java.lang.Class<?>> |
exclusions |
private AbstractTypeAwareSupport.BeansOfTypeTargetSource |
targetSource |
private java.lang.Class<T> |
type |
| Constructor and Description |
|---|
AbstractTypeAwareSupport() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected java.util.List<T> |
getBeans()
Returns all beans from the
ApplicationContext that match the given type. |
void |
onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event) |
void |
setApplicationContext(org.springframework.context.ApplicationContext context) |
void |
setExclusions(java.lang.Class<?>[] exclusions)
Configures the types to be excluded from the lookup.
|
void |
setType(java.lang.Class<T> type)
Configures the type of beans to be looked up.
|
private org.springframework.context.ApplicationContext context
private java.lang.Class<T> type
private AbstractTypeAwareSupport.BeansOfTypeTargetSource targetSource
private java.util.Collection<java.lang.Class<?>> exclusions
public void setApplicationContext(org.springframework.context.ApplicationContext context)
setApplicationContext in interface org.springframework.context.ApplicationContextAwarepublic void setType(java.lang.Class<T> type)
type - the type to setpublic void setExclusions(java.lang.Class<?>[] exclusions)
exclusions - protected java.util.List<T> getBeans()
ApplicationContext that match the given type.public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanpublic void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>