Class SingletonTargetSource
java.lang.Object
org.springframework.aop.target.SingletonTargetSource
- All Implemented Interfaces:
- Serializable,- TargetClassAware,- TargetSource
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.
- Author:
- Rod Johnson, Juergen Hoeller
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionSingletonTargetSource(Object target) Create a new SingletonTargetSource for the given target.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanTwo invoker interceptors are equal if they have the same target or if the targets or the targets are equal.Return a target instance.Class<?> Return the type of targets returned by thisTargetSource.inthashCode()SingletonTargetSource uses the hash code of the target object.booleanisStatic()Will all calls toTargetSource.getTarget()return the same object?toString()Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.aop.TargetSourcereleaseTarget
- 
Constructor Details- 
SingletonTargetSourceCreate a new SingletonTargetSource for the given target.- Parameters:
- target- the target object
 
 
- 
- 
Method Details- 
getTargetClassDescription copied from interface:TargetSourceReturn the type of targets returned by thisTargetSource.Can return null, although certain usages of aTargetSourcemight just work with a predetermined target class.- Specified by:
- getTargetClassin interface- TargetClassAware
- Specified by:
- getTargetClassin interface- TargetSource
- Returns:
- the type of targets returned by this TargetSource
 
- 
getTargetDescription copied from interface:TargetSourceReturn a target instance. Invoked immediately before the AOP framework calls the "target" of an AOP method invocation.- Specified by:
- getTargetin interface- TargetSource
- Returns:
- the target object which contains the joinpoint,
 or nullif there is no actual target instance
 
- 
isStaticpublic boolean isStatic()Description copied from interface:TargetSourceWill all calls toTargetSource.getTarget()return the same object?In that case, there will be no need to invoke TargetSource.releaseTarget(Object), and the AOP framework can cache the return value ofTargetSource.getTarget().The default implementation returns false.- Specified by:
- isStaticin interface- TargetSource
- Returns:
- trueif the target is immutable
- See Also:
 
- 
equals
- 
hashCode
- 
toString
 
-