org.springframework.aop.target
Class EmptyTargetSource

java.lang.Object
  extended by org.springframework.aop.target.EmptyTargetSource
All Implemented Interfaces:
Serializable, TargetSource

public class EmptyTargetSource
extends Object
implements TargetSource, Serializable

Canonical TargetSource when there's no target, and behavior is supplied by interfaces and advisors.

Author:
Rod Johnson
See Also:
Serialized Form

Field Summary
static EmptyTargetSource INSTANCE
           
 
Method Summary
 Object getTarget()
          Return a target instance.
 Class getTargetClass()
          Return the type of targets returned by this TargetSource.
 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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INSTANCE

public static final EmptyTargetSource INSTANCE
Method Detail

getTargetClass

public Class getTargetClass()
Description copied from interface: TargetSource
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.

Specified by:
getTargetClass in interface TargetSource

isStatic

public boolean isStatic()
Description copied from interface: TargetSource
Will all calls to getTarget() 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().

Specified by:
isStatic in interface TargetSource
Returns:
whether the target is immutable
See Also:
TargetSource.getTarget()

getTarget

public Object getTarget()
Description copied from interface: TargetSource
Return a target instance. Invoked immediately before the AOP framework calls the "target" of an AOP method invocation.

Specified by:
getTarget in interface TargetSource
Returns:
the target object, whicch contains the joinpoint

releaseTarget

public void releaseTarget(Object target)
Description copied from interface: TargetSource
Release the given target object obtained from the getTarget() method.

Specified by:
releaseTarget in interface TargetSource
Parameters:
target - object obtained from a call to getTarget()
See Also:
TargetSource.getTarget()

toString

public String toString()
Overrides:
toString in class Object


Copyright (c) 2002-2007 The Spring Framework Project.