Package org.apache.wicket.spring
Class SpringBeanLocator
- java.lang.Object
-
- org.apache.wicket.spring.SpringBeanLocator
-
- All Implemented Interfaces:
java.io.Serializable,org.apache.wicket.proxy.IProxyTargetLocator,org.apache.wicket.util.io.IClusterable
public class SpringBeanLocator extends java.lang.Object implements org.apache.wicket.proxy.IProxyTargetLocatorImplementation 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(java.lang.Class<?> beanType, java.lang.reflect.Field beanField, ISpringContextLocator locator)ConstructorSpringBeanLocator(java.lang.Class<?> beanType, ISpringContextLocator locator)ConstructorSpringBeanLocator(java.lang.String beanName, java.lang.Class<?> beanType, java.lang.reflect.Field beanField, ISpringContextLocator locator)ConstructorSpringBeanLocator(java.lang.String beanName, java.lang.Class<?> beanType, ISpringContextLocator locator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)org.springframework.beans.factory.support.RootBeanDefinitiongetBeanDefinition(org.springframework.context.ApplicationContext ctx, java.lang.String name)Gets the root bean definition for the given name.java.lang.StringgetBeanName()java.lang.Class<?>getBeanType()ISpringContextLocatorgetSpringContextLocator()inthashCode()booleanisSingletonBean()java.lang.ObjectlocateProxyTarget()
-
-
-
Constructor Detail
-
SpringBeanLocator
public SpringBeanLocator(java.lang.Class<?> beanType, ISpringContextLocator locator)Constructor- Parameters:
beanType- bean classlocator- spring context locator
-
SpringBeanLocator
public SpringBeanLocator(java.lang.String beanName, java.lang.Class<?> beanType, ISpringContextLocator locator)
-
SpringBeanLocator
public SpringBeanLocator(java.lang.Class<?> beanType, java.lang.reflect.Field beanField, ISpringContextLocator locator)Constructor- Parameters:
beanType- bean classlocator- spring context locator
-
SpringBeanLocator
public SpringBeanLocator(java.lang.String beanName, java.lang.Class<?> beanType, java.lang.reflect.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 java.lang.Class<?> getBeanType()
- Returns:
- bean class this locator is configured with
-
locateProxyTarget
public java.lang.Object locateProxyTarget()
- Specified by:
locateProxyTargetin interfaceorg.apache.wicket.proxy.IProxyTargetLocator
-
getBeanName
public final java.lang.String getBeanName()
- Returns:
- bean name this locator is configured with
-
getSpringContextLocator
public final ISpringContextLocator getSpringContextLocator()
- Returns:
- context locator this locator is configured with
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getBeanDefinition
public org.springframework.beans.factory.support.RootBeanDefinition getBeanDefinition(org.springframework.context.ApplicationContext ctx, java.lang.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.
-
-