Save This Page
Home » spring-framework-2.5.5-with-dependencies » org.springframework » aop » [javadoc | source]
org.springframework.aop
public interface: TargetSource [javadoc | source]

All Implemented Interfaces:
    TargetClassAware

All Known Implementing Classes:
    EmptyTargetSource, LazyInitTargetSource, HotSwappableTargetSource, AbstractRefreshableTargetSource, MBeanServerConnectionLazyInitTargetSource, SimpleBeanTargetSource, BeanFactoryRefreshableTargetSource, SingletonTargetSource, CommonsPoolTargetSource, PrototypeTargetSource, AbstractPoolingTargetSource, RefreshableScriptTargetSource, JndiObjectTargetSource, AbstractPrototypeBasedTargetSource, NotificationPublisherAwareLazyTargetSource, ThreadLocalTargetSource, AbstractLazyCreationTargetSource, AbstractBeanFactoryBasedTargetSource, JMXConnectorLazyInitTargetSource

A TargetSource is used to obtain the current "target" of an AOP invocation, which will be invoked via reflection if no around advice chooses to end the interceptor chain itself.

If a TargetSource is "static", it will always return the same target, allowing optimizations in the AOP framework. Dynamic target sources can support pooling, hot swapping, etc.

Application developers don't usually need to work with TargetSources directly: this is an AOP framework interface.

Method from org.springframework.aop.TargetSource Summary:
getTarget,   getTargetClass,   isStatic,   releaseTarget
Method from org.springframework.aop.TargetSource Detail:
 public Object getTarget() throws Exception
    Return a target instance. Invoked immediately before the AOP framework calls the "target" of an AOP method invocation.
 public Class getTargetClass()
    Return the type of targets returned by this TargetSource .

    Can return null, although certain usages of a TargetSource might just work with a predetermined target class.

 public boolean isStatic()
 public  void releaseTarget(Object target) throws Exception
    Release the given target object obtained from the #getTarget() method.