Top Description Fields Constructors Methods
org.springframework.aop.aspectj.annotation

public Class AspectMetadata

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Annotations
@SuppressWarnings:serial
Imports
java.io.IOException, .ObjectInputStream, .Serializable, org.aspectj.lang.annotation.Aspect, org.aspectj.lang.reflect.AjType, .AjTypeSystem, .PerClauseKind, org.springframework.aop.Pointcut, org.springframework.aop.aspectj.AspectJExpressionPointcut, .TypePatternClassFilter, org.springframework.aop.framework.AopConfigException, org.springframework.aop.support.ComposablePointcut

Metadata for an AspectJ aspect class, with an additional Spring AOP pointcut for the per clause.

Uses AspectJ 5 AJType reflection API, enabling us to work with different AspectJ instantiation models such as "singleton", "pertarget" and "perthis".

Authors
Rod Johnson, Juergen Hoeller
Since
2.0
See Also
org.springframework.aop.aspectj.AspectJExpressionPointcut

Field Summary

Modifier and TypeField and Description
private transient AjType<?>
ajType

AspectJ reflection information.

private final Class<?>
aspectClass

The aspect class, stored separately for re-resolution of the corresponding AjType on deserialization.

private final String
aspectName

The name of this aspect as defined to Spring (the bean name) - allows us to determine if two pieces of advice come from the same aspect and hence their relative precedence.

private final Pointcut
perClausePointcut

Spring AOP pointcut corresponding to the per clause of the aspect.

Constructor Summary

AccessConstructor and Description
public
AspectMetadata(Class<?>
the aspect class
aspectClass
,
String
the name of the aspect
aspectName
)

Create a new AspectMetadata instance for the given aspect class.

Method Summary

Modifier and TypeMethod and Description
private String
findPerClause(Class<?> aspectClass)

Extract contents from String of form pertarget(contents).

public AjType<?>
getAjType()

Return AspectJ reflection information.

public Class<?>
getAspectClass()

Return the aspect class.

public String
getAspectName()

Return the aspect name.

public Pointcut
getPerClausePointcut()

Return a Spring pointcut expression for a singleton aspect.

public boolean
isLazilyInstantiated()

Return whether the aspect needs to be lazily instantiated.

public boolean
isPerThisOrPerTarget()

Return whether the aspect is defined as "perthis" or "pertarget".

public boolean
isPerTypeWithin()

Return whether the aspect is defined as "pertypewithin".

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ajTypeback to summary
private transient AjType<?> ajType

AspectJ reflection information.

Re-resolved on deserialization since it isn't serializable itself.

aspectClassback to summary
private final Class<?> aspectClass

The aspect class, stored separately for re-resolution of the corresponding AjType on deserialization.

aspectNameback to summary
private final String aspectName

The name of this aspect as defined to Spring (the bean name) - allows us to determine if two pieces of advice come from the same aspect and hence their relative precedence.

perClausePointcutback to summary
private final Pointcut perClausePointcut

Spring AOP pointcut corresponding to the per clause of the aspect. Will be the Pointcut.TRUE canonical instance in the case of a singleton, otherwise an AspectJExpressionPointcut.

Constructor Detail

AspectMetadataback to summary
public AspectMetadata(Class<?> aspectClass, String aspectName)

Create a new AspectMetadata instance for the given aspect class.

Parameters
aspectClass:Class<?>

the aspect class

aspectName:String

the name of the aspect

Method Detail

findPerClauseback to summary
private String findPerClause(Class<?> aspectClass)

Extract contents from String of form pertarget(contents).

getAjTypeback to summary
public AjType<?> getAjType()

Return AspectJ reflection information.

getAspectClassback to summary
public Class<?> getAspectClass()

Return the aspect class.

getAspectNameback to summary
public String getAspectName()

Return the aspect name.

getPerClausePointcutback to summary
public Pointcut getPerClausePointcut()

Return a Spring pointcut expression for a singleton aspect. (e.g. Pointcut.TRUE if it's a singleton).

isLazilyInstantiatedback to summary
public boolean isLazilyInstantiated()

Return whether the aspect needs to be lazily instantiated.

isPerThisOrPerTargetback to summary
public boolean isPerThisOrPerTarget()

Return whether the aspect is defined as "perthis" or "pertarget".

isPerTypeWithinback to summary
public boolean isPerTypeWithin()

Return whether the aspect is defined as "pertypewithin".

readObjectback to summary
private void readObject(ObjectInputStream inputStream) throws IOException, ClassNotFoundException