public abstract class AbstractAspectJAdvice extends ObjectSE implements Advice, AspectJPrecedenceInformation, SerializableSE
Advice クラスの基本クラス。| 修飾子と型 | フィールドと説明 |
|---|---|
protected MethodSE | aspectJAdviceMethod |
protected static StringSE | JOIN_POINT_KEY 現在のジョインポイントの ReflectiveMethodInvocation userAtributes マップ内で使用されるキー。 |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| コンストラクターと説明 |
|---|
AbstractAspectJAdvice(MethodSE aspectJAdviceMethod, AspectJExpressionPointcut pointcut, AspectInstanceFactory aspectInstanceFactory) 指定されたアドバイスメソッド用に新しい AbstractAspectJAdvice を作成します。 |
| 修飾子と型 | メソッドと説明 |
|---|---|
protected ObjectSE[] | argBinding(org.aspectj.lang.JoinPoint jp, org.aspectj.weaver.tools.JoinPointMatch jpMatch, ObjectSE returnValue, ThrowableSE ex) メソッド実行ジョインポイントで引数を取り、アドバイスメソッドに引数のセットを出力します |
Pointcut | buildSafePointcut()AspectJ アドバイスメソッド自体を除外する「安全な」ポイントカットを作成します。 |
void | calculateArgumentBindings() セットアップの一部としてできる限り多くの作業を行い、後続のアドバイス呼び出しでの引数バインディングが可能な限り高速になるようにします。 |
protected ParameterNameDiscoverer | createParameterNameDiscoverer() 引数のバインドに使用する ParameterNameDiscoverer を作成します。 |
static org.aspectj.lang.JoinPoint | currentJoinPoint() 現在の呼び出しのジョインポイントを遅延的にインスタンス化します。 |
ClassLoaderSE | getAspectClassLoader() アスペクトインスタンスの ClassLoader を返します。 |
AspectInstanceFactory | getAspectInstanceFactory() アスペクトインスタンスのファクトリを返します。 |
MethodSE | getAspectJAdviceMethod()AspectJ スタイルのアドバイスメソッドを返します。 |
StringSE | getAspectName() アドバイスが宣言されたアスペクト(Bean)の名前。 |
int | getDeclarationOrder() アスペクト内のアドバイスメンバーの宣言順序。 |
protected TypeSE | getDiscoveredReturningGenericType() |
protected ClassSE<?> | getDiscoveredReturningType() |
protected ClassSE<?> | getDiscoveredThrowingType() |
protected org.aspectj.lang.JoinPoint | getJoinPoint() 進行中のジョインポイントを返すためのアドバイスでオーバーライドされます。 |
protected org.aspectj.weaver.tools.JoinPointMatch | getJoinPointMatch() ディスパッチされているジョインポイントでの現在のジョインポイントの一致を取得します。 |
protected org.aspectj.weaver.tools.JoinPointMatch | getJoinPointMatch(ProxyMethodInvocation pmi) |
int | getOrder() このオブジェクトの順序値を取得します。 |
AspectJExpressionPointcut | getPointcut()AspectJ 式のポイントカットを返します。 |
protected ObjectSE | invokeAdviceMethod(org.aspectj.lang.JoinPoint jp, org.aspectj.weaver.tools.JoinPointMatch jpMatch, ObjectSE returnValue, ThrowableSE t) |
protected ObjectSE | invokeAdviceMethod(org.aspectj.weaver.tools.JoinPointMatch jpMatch, ObjectSE returnValue, ThrowableSE ex)advice メソッドを呼び出します。 |
protected ObjectSE | invokeAdviceMethodWithGivenArgs(ObjectSE[] args) |
void | setArgumentNames(StringSE argNames) 引数名がわかっている場合、このアドバイスオブジェクトの作成者によって設定されます。 |
void | setArgumentNamesFromStringArray(StringSE... args) |
void | setAspectName(StringSE name) |
void | setDeclarationOrder(int order) アスペクト内でこのアドバイスの宣言順序を設定します。 |
void | setReturningName(StringSE name) |
protected void | setReturningNameNoCheck(StringSE name) 引数バインディングの計算のために、返される名前をこのレベルで保持する必要があります。このメソッドにより、afterReturning アドバイスサブクラスが名前を設定できます。 |
void | setThrowingName(StringSE name) |
protected void | setThrowingNameNoCheck(StringSE name) 引数バインディングの計算のために、このレベルでスロー名を保持する必要があります。このメソッドにより、afterThrowing アドバイスサブクラスで名前を設定できます。 |
protected boolean | supportsProceedingJoinPoint() |
StringSE | toString() |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, waitSE, waitSE, waitSEisAfterAdvice, isBeforeAdviceprotected static final StringSE JOIN_POINT_KEY
protected transient MethodSE aspectJAdviceMethod
public AbstractAspectJAdvice(MethodSE aspectJAdviceMethod, AspectJExpressionPointcut pointcut, AspectInstanceFactory aspectInstanceFactory)
aspectJAdviceMethod - AspectJ スタイルのアドバイスメソッド pointcut - AspectJ 式のポイントカット aspectInstanceFactory - アスペクトインスタンスのファクトリ public static org.aspectj.lang.JoinPoint currentJoinPoint()
現在の ReflectiveMethodInvocation にアクセスできる場合は、使用しないでください(アラウンドアドバイス)。
public final MethodSE getAspectJAdviceMethod()
public final AspectJExpressionPointcut getPointcut()
public final Pointcut buildSafePointcut()
getPointcut()public final AspectInstanceFactory getAspectInstanceFactory()
public final ClassLoaderSE getAspectClassLoader()
public int getOrder()
Ordered 値が高いほど、優先度は低くなります。結果として、最も低い値を持つオブジェクトが最高の優先度を持ちます(サーブレット load-on-startup の値に多少似ています)。
同じ順序の値は、影響を受けるオブジェクトの任意のソート位置になります。
Ordered の getOrder Ordered.HIGHEST_PRECEDENCE, Ordered.LOWEST_PRECEDENCEpublic void setAspectName(StringSE name)
public StringSE getAspectName()
AspectJPrecedenceInformationAspectJPrecedenceInformation の getAspectName public void setDeclarationOrder(int order)
public int getDeclarationOrder()
AspectJPrecedenceInformationAspectJPrecedenceInformation の getDeclarationOrder public void setArgumentNames(StringSE argNames)
たとえば、XML またはアドバイスアノテーションで明示的に指定されているためです。
argNames - 引数名のカンマ区切りリスト public void setArgumentNamesFromStringArray(StringSE... args)
public void setReturningName(StringSE name)
protected void setReturningNameNoCheck(StringSE name)
protected ClassSE<?> getDiscoveredReturningType()
protected TypeSE getDiscoveredReturningGenericType()
public void setThrowingName(StringSE name)
protected void setThrowingNameNoCheck(StringSE name)
protected ClassSE<?> getDiscoveredThrowingType()
public final void calculateArgumentBindings()
最初の引数の型が JoinPoint または ProceedingJoinPoint の場合、その位置に JoinPoint を渡します(アラウンドアドバイスの場合は ProceedingJoinPoint)。
最初の引数が JoinPoint.StaticPart 型の場合、その位置に JoinPoint.StaticPart を渡します。
残りの引数は、指定されたジョインポイントでポイントカット評価によってバインドされる必要があります。引数名から値へのマップを取得します。どのアドバイスパラメーターをどの引数名にバインドする必要があるかを計算する必要があります。このバインディングを決定するには、ChainOfResponsibility に配置された複数の戦略があります。
protected boolean supportsProceedingJoinPoint()
protected ParameterNameDiscoverer createParameterNameDiscoverer()
デフォルトの実装では、DefaultParameterNameDiscoverer を作成し、特別に構成された AspectJAdviceParameterNameDiscoverer を追加します。
protected ObjectSE[] argBinding(org.aspectj.lang.JoinPoint jp, org.aspectj.weaver.tools.JoinPointMatch jpMatch, ObjectSE returnValue, ThrowableSE ex)
jp - 現在の JoinPointjpMatch - この実行ジョインポイントに一致したジョインポイントの一致 returnValue - メソッド実行からの戻り値 (null の可能性があります)ex - メソッドの実行によってスローされた例外 (null の可能性があります)protected ObjectSE invokeAdviceMethod(org.aspectj.weaver.tools.JoinPointMatch jpMatch, ObjectSE returnValue, ThrowableSE ex) throws ThrowableSE
jpMatch - この実行ジョインポイントに一致した JoinPointMatchreturnValue - メソッド実行からの戻り値 (null の可能性があります)ex - メソッドの実行によってスローされた例外 (null の可能性があります)ThrowableSE - 呼び出しが失敗した場合 protected ObjectSE invokeAdviceMethod(org.aspectj.lang.JoinPoint jp, org.aspectj.weaver.tools.JoinPointMatch jpMatch, ObjectSE returnValue, ThrowableSE t) throws ThrowableSE
ThrowableSEprotected ObjectSE invokeAdviceMethodWithGivenArgs(ObjectSE[] args) throws ThrowableSE
ThrowableSEprotected org.aspectj.lang.JoinPoint getJoinPoint()
protected org.aspectj.weaver.tools.JoinPointMatch getJoinPointMatch()
protected org.aspectj.weaver.tools.JoinPointMatch getJoinPointMatch(ProxyMethodInvocation pmi)
public StringSE toString()
ObjectSE の toStringSE