Class 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 of IProxyTargetLocator 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 Detail

      • SpringBeanLocator

        public SpringBeanLocator​(Class<?> beanType,
                                 ISpringContextLocator locator)
        Constructor
        Parameters:
        beanType - bean class
        locator - spring context locator
      • SpringBeanLocator

        public SpringBeanLocator​(Class<?> beanType,
                                 Field beanField,
                                 ISpringContextLocator locator)
        Constructor
        Parameters:
        beanType - bean class
        locator - spring context locator
      • SpringBeanLocator

        public SpringBeanLocator​(String beanName,
                                 Class<?> beanType,
                                 Field beanField,
                                 ISpringContextLocator locator)
        Constructor
        Parameters:
        beanName - bean name
        beanType - bean class
        locator - 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:
        locateProxyTarget in interface org.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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • 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.