|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.aop.target.SingletonTargetSource
public final class SingletonTargetSource
Implementation of the TargetSource interface
that holds a given object. This is the default implementation of the TargetSource
interface, as used by the Spring AOP framework. There is usually no need to
create objects of this class in application code.
This class is serializable. However, the actual serializability of a SingletonTargetSource will depend on whether the target is serializable.
AdvisedSupport.setTarget(java.lang.Object),
Serialized Form| Constructor Summary | |
|---|---|
SingletonTargetSource(Object target)
Create a new SingletonTargetSource for the given target. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object other)
Two invoker interceptors are equal if they have the same target or if the targets or the targets are equal. |
Object |
getTarget()
Return a target instance. |
Class |
getTargetClass()
Return the type of targets returned by this TargetSource. |
int |
hashCode()
SingletonTargetSource uses the hash code of the target object. |
boolean |
isStatic()
Will all calls to getTarget() return the same object? |
void |
releaseTarget(Object target)
Release the given target object obtained from the getTarget() method. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SingletonTargetSource(Object target)
target - the target object| Method Detail |
|---|
public Class getTargetClass()
TargetSourcenull, although certain usages of a TargetSource
might just work with a predetermined target class.
getTargetClass in interface TargetSourcepublic Object getTarget()
TargetSource
getTarget in interface TargetSourcepublic void releaseTarget(Object target)
TargetSourcegetTarget() method.
releaseTarget in interface TargetSourcetarget - object obtained from a call to getTarget()TargetSource.getTarget()public boolean isStatic()
TargetSourcegetTarget() return the same object?
In that case, there will be no need to invoke releaseTarget,
and the AOP framework can cache the return value of getTarget().
isStatic in interface TargetSourceTargetSource.getTarget()public boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||