Package org.apache.wicket.spring
Class SpringBeanLocator
- java.lang.Object
-
- org.apache.wicket.spring.SpringBeanLocator
-
- All Implemented Interfaces:
Serializable
,IProxyTargetLocator
,IClusterable
public class SpringBeanLocator extends Object implements IProxyTargetLocator
Implementation ofIProxyTargetLocator
that 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 boolean
equals(Object obj)
org.springframework.beans.factory.support.RootBeanDefinition
getBeanDefinition(org.springframework.context.ApplicationContext ctx, String name)
Gets the root bean definition for the given name.String
getBeanName()
Class<?>
getBeanType()
ISpringContextLocator
getSpringContextLocator()
int
hashCode()
boolean
isSingletonBean()
Object
locateProxyTarget()
Returns the object that will be used as target object for a lazy init proxy.
-
-
-
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()
Description copied from interface:IProxyTargetLocator
Returns the object that will be used as target object for a lazy init proxy.- Specified by:
locateProxyTarget
in interfaceIProxyTargetLocator
- Returns:
- retrieved object
-
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.
-
-