Package org.apache.wicket.spring
Class SpringBeanLocator
- java.lang.Object
-
- org.apache.wicket.spring.SpringBeanLocator
-
- All Implemented Interfaces:
Serializable,org.apache.wicket.proxy.IProxyTargetLocator,org.apache.wicket.util.io.IClusterable
public class SpringBeanLocator extends Object implements org.apache.wicket.proxy.IProxyTargetLocator
Implementation ofIProxyTargetLocatorthat can locate beans within a spring application context. Beans are looked up by the combination of name and type, if name is omitted only type is used.- Author:
- Igor Vaynberg (ivaynberg), Istvan Devai, Tobias Soloschenko
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SpringBeanLocator(Class<?> beanType, Field beanField, ISpringContextLocator locator)ConstructorSpringBeanLocator(Class<?> beanType, ISpringContextLocator locator)ConstructorSpringBeanLocator(String beanName, Class<?> beanType, Field beanField, ISpringContextLocator locator)ConstructorSpringBeanLocator(String beanName, Class<?> beanType, ISpringContextLocator locator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)org.springframework.beans.factory.support.RootBeanDefinitiongetBeanDefinition(org.springframework.context.ApplicationContext ctx, String name)Gets the root bean definition for the given name.StringgetBeanName()Class<?>getBeanType()ISpringContextLocatorgetSpringContextLocator()inthashCode()booleanisSingletonBean()ObjectlocateProxyTarget()
-
-
-
Constructor Detail
-
SpringBeanLocator
public SpringBeanLocator(Class<?> beanType, ISpringContextLocator locator)
Constructor- Parameters:
beanType- bean classlocator- spring context locator
-
SpringBeanLocator
public SpringBeanLocator(String beanName, Class<?> beanType, ISpringContextLocator locator)
-
SpringBeanLocator
public SpringBeanLocator(Class<?> beanType, Field beanField, ISpringContextLocator locator)
Constructor- Parameters:
beanType- bean classlocator- spring context locator
-
SpringBeanLocator
public SpringBeanLocator(String beanName, Class<?> beanType, Field beanField, ISpringContextLocator locator)
Constructor- Parameters:
beanName- bean namebeanType- bean classlocator- spring context locator
-
-
Method Detail
-
isSingletonBean
public boolean isSingletonBean()
- Returns:
- returns whether the bean (the locator is supposed to istantiate) is a singleton or not
-
getBeanType
public Class<?> getBeanType()
- Returns:
- bean class this locator is configured with
-
locateProxyTarget
public Object locateProxyTarget()
- Specified by:
locateProxyTargetin interfaceorg.apache.wicket.proxy.IProxyTargetLocator
-
getBeanName
public final String getBeanName()
- Returns:
- bean name this locator is configured with
-
getSpringContextLocator
public final ISpringContextLocator getSpringContextLocator()
- Returns:
- context locator this locator is configured with
-
getBeanDefinition
public org.springframework.beans.factory.support.RootBeanDefinition getBeanDefinition(org.springframework.context.ApplicationContext ctx, String name)
Gets the root bean definition for the given name.- Parameters:
ctx- spring application context.name- bean name- Returns:
- bean definition for the current name, null if such a definition is not found.
-
-