|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.wicketstuff.springreference.AbstractSpringReferenceSupporter
public abstract class AbstractSpringReferenceSupporter
Abstract base class for spring bean finding. Used by AbstractSpringReference.
This class is intended to be used in a singleton/service way because it maintains caches to speed up lookups. Subclasses must implement the getApplicationContext() method used to locate the spring context. This class does not depend on wicket or spring-web. So in theory subclasses can be used in non-wicket, non-web spring applications too.
| Constructor Summary | |
|---|---|
AbstractSpringReferenceSupporter()
|
|
| Method Summary | ||
|---|---|---|
void |
clearCache()
Clears the internal cache. |
|
|
findAndSetInstance(AbstractSpringReference<T> ref)
Looks up the spring bean from a spring ApplicationContext. |
|
protected
|
findBeanName(AbstractSpringReference<T> ref)
Finds out the exact name for a spring bean. |
|
protected abstract ApplicationContext |
getApplicationContext()
|
|
protected BeanDefinition |
getBeanDefinition(ConfigurableListableBeanFactory fact,
String name)
Tries to get the BeanDefinition of a spring bean. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractSpringReferenceSupporter()
| Method Detail |
|---|
public <T> T findAndSetInstance(AbstractSpringReference<T> ref)
ApplicationContext. The bean is set in the
reference. If the name was not given for the reference this method will fill that too. Throws
a RuntimeException if the bean could not be found.
T - type of the wrapped spring beanref - reference where the instance will be set
RuntimeException if loading failed.protected <T> String findBeanName(AbstractSpringReference<T> ref)
T - type of the wrapped spring beanref - reference to find name for
IllegalStateException if there is not exactly one
candidate.
protected BeanDefinition getBeanDefinition(ConfigurableListableBeanFactory fact,
String name)
BeanDefinition of a spring bean.
fact - spring bean factoryname - spring bean name to find definition for
protected abstract ApplicationContext getApplicationContext()
public void clearCache()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||