org.apache.wicket.spring
Class SpringBeanLocator

java.lang.Object
  extended by org.apache.wicket.spring.SpringBeanLocator
All Implemented Interfaces:
Serializable, IClusterable, IProxyTargetLocator

public class SpringBeanLocator
extends Object
implements 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
See Also:
Serialized Form

Constructor Summary
SpringBeanLocator(Class<?> beanType, ISpringContextLocator locator)
          Constructor
SpringBeanLocator(String beanName, Class<?> beanType, ISpringContextLocator locator)
          Constructor
 
Method Summary
 boolean equals(Object obj)
           
 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.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringBeanLocator

public SpringBeanLocator(Class<?> beanType,
                         ISpringContextLocator locator)
Constructor

Parameters:
beanType - bean class
locator - spring context locator

SpringBeanLocator

public SpringBeanLocator(String beanName,
                         Class<?> beanType,
                         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()
Description copied from interface: IProxyTargetLocator
Returns the object that will be used as target object for a lazy init proxy.

Specified by:
locateProxyTarget in interface IProxyTargetLocator
Returns:
retrieved object
See Also:
IProxyTargetLocator.locateProxyTarget()

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

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.