T
- type of the wrapped spring beanpublic abstract class AbstractSpringReference<T> extends Object implements Serializable, Cloneable
An abstract base class for referring spring beans.
This class supports serialization. The referred spring bean does not get serialized, after deserialization it is looked up again on the first access.
Subclasses must implement the getSupporter()
method used to locate the
AbstractSpringReferenceSupporter
object. This class does not depend on wicket or
spring-web. So in theory subclasses can be used in non-wicket, non-web spring applications too.
Modifier | Constructor and Description |
---|---|
protected |
AbstractSpringReference(Class<T> clazz,
String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
AbstractSpringReference<T> |
clone() |
boolean |
equals(Object obj) |
T |
get()
Returns the referred spring bean.
|
protected Class<T> |
getClazz() |
protected String |
getName()
Can change during lookup if it was not set originally.
|
protected abstract AbstractSpringReferenceSupporter |
getSupporter() |
int |
hashCode() |
protected boolean |
isClazzBasedOnlyLookup() |
protected void |
setInstanceRef(WeakReference<T> instanceRef) |
protected void |
setName(String name) |
public T get()
RuntimeException
if the bean could not be
found.public AbstractSpringReference<T> clone()
protected abstract AbstractSpringReferenceSupporter getSupporter()
protected void setInstanceRef(WeakReference<T> instanceRef)
instanceRef
- weak reference to the spring beanprotected String getName()
protected void setName(String name)
name
- name of the spring beanprotected boolean isClazzBasedOnlyLookup()
Copyright © 2015. All rights reserved.