クラス AbstractAspectJAdvice
java.lang.ObjectSE
org.springframework.aop.aspectj.AbstractAspectJAdvice
- 実装されているすべてのインターフェース:
SerializableSE、Advice、AspectJPrecedenceInformation、Ordered
- 既知の直属サブクラス
AspectJAfterAdvice、AspectJAfterReturningAdvice、AspectJAfterThrowingAdvice、AspectJAroundAdvice、AspectJMethodBeforeAdvice
public abstract class AbstractAspectJAdvice
extends ObjectSE
implements Advice, AspectJPrecedenceInformation, SerializableSE
AspectJ アスペクトまたは AspectJ アノテーション付きアドバイスメソッドをラップする AOPAlliance
Advice クラスの基本クラス。- 導入:
- 2.0
- 作成者:
- Rod Johnson, Adrian Colyer, Juergen Hoeller, Ramnivas Laddad
- 関連事項:
フィールドのサマリー
フィールド修飾子と型フィールド説明protected MethodSEprotected static final StringSE現在のジョインポイントの ReflectiveMethodInvocation userAttributes マップ内で使用されるキー。インターフェース org.springframework.core.Ordered から継承されたフィールド
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) メソッド実行ジョインポイントで引数を取り、アドバイスメソッドに一連の引数を出力します。final PointcutAspectJ アドバイスメソッド自体を除外する「安全な」ポイントカットを作成します。final voidセットアップの一部としてできる限り多くの作業を行い、後続のアドバイス呼び出しでの引数バインディングが可能な限り高速になるようにします。protected ParameterNameDiscoverer引数のバインドに使用する ParameterNameDiscoverer を作成します。static org.aspectj.lang.JoinPoint現在の呼び出しのジョインポイントを遅延的にインスタンス化します。final ClassLoaderSEアスペクトインスタンスの ClassLoader を返します。final AspectInstanceFactoryアスペクトインスタンスのファクトリを返します。final MethodSEAspectJ スタイルのアドバイスメソッドを返します。アドバイスが宣言されたアスペクトの名前(Bean)を返します。intアスペクト内のアドバイスメンバーの宣言順序を返します。protected TypeSEprotected ClassSE<?>protected ClassSE<?>protected org.aspectj.lang.JoinPoint進行中のジョインポイントを返すためのアドバイスでオーバーライドされます。protected org.aspectj.weaver.tools.JoinPointMatchディスパッチされているジョインポイントでの現在のジョインポイントの一致を取得します。protected org.aspectj.weaver.tools.JoinPointMatchintgetOrder()このオブジェクトの順序値を取得します。AspectJ 式のポイントカットを返します。protected ObjectSEinvokeAdviceMethod(org.aspectj.lang.JoinPoint jp, org.aspectj.weaver.tools.JoinPointMatch jpMatch, ObjectSE returnValue, ThrowableSE t) protected ObjectSEinvokeAdviceMethod(org.aspectj.weaver.tools.JoinPointMatch jpMatch, ObjectSE returnValue, ThrowableSE ex) advice メソッドを呼び出します。protected ObjectSEvoidsetArgumentNames(StringSE argumentNames) 引数名がわかっている場合、このアドバイスオブジェクトの作成者によって設定されます。voidsetArgumentNamesFromStringArray(StringSE... argumentNames) 引数名がわかっている場合、このアドバイスオブジェクトの作成者によって設定されます。voidsetAspectName(StringSE name) アドバイスが宣言されたアスペクトの名前(Bean)を設定します。voidsetDeclarationOrder(int order) アスペクト内でこのアドバイスの宣言順序を設定します。voidsetReturningName(StringSE name) protected void引数バインディングの計算のために、返される名前をこのレベルで保持する必要があります。このメソッドにより、afterReturning アドバイスサブクラスが名前を設定できます。voidsetThrowingName(StringSE name) protected void引数バインディングの計算のために、このレベルでスロー名を保持する必要があります。このメソッドにより、afterThrowing アドバイスサブクラスで名前を設定できます。protected booleantoString()クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSEインターフェース org.springframework.aop.aspectj.AspectJPrecedenceInformation から継承されたメソッド
isAfterAdvice, isBeforeAdvice
フィールドの詳細
JOIN_POINT_KEY
現在のジョインポイントの ReflectiveMethodInvocation userAttributes マップ内で使用されるキー。aspectJAdviceMethod
コンストラクターの詳細
AbstractAspectJAdvice
public AbstractAspectJAdvice(MethodSE aspectJAdviceMethod, AspectJExpressionPointcut pointcut, AspectInstanceFactory aspectInstanceFactory) 指定されたアドバイスメソッド用に新しい AbstractAspectJAdvice を作成します。- パラメーター:
aspectJAdviceMethod- AspectJ スタイルのアドバイスメソッドpointcut- AspectJ 式のポイントカットaspectInstanceFactory- アスペクトインスタンスのファクトリ
メソッドの詳細
currentJoinPoint
public static org.aspectj.lang.JoinPoint currentJoinPoint()現在の呼び出しのジョインポイントを遅延的にインスタンス化します。MethodInvocation を ExposeInvocationInterceptor とバインドする必要があります。現在の ReflectiveMethodInvocation にアクセスできる場合は、使用しないでください(アラウンドアドバイス)。
- 戻り値:
- 現在の AspectJ ジョインポイント、または Spring AOP 呼び出し中でない場合は例外を使用します。
getAspectJAdviceMethod
AspectJ スタイルのアドバイスメソッドを返します。getPointcut
AspectJ 式のポイントカットを返します。buildSafePointcut
AspectJ アドバイスメソッド自体を除外する「安全な」ポイントカットを作成します。- 戻り値:
- 元の AspectJ 式のポイントカット上に構築される構成可能なポイントカット
- 関連事項:
getAspectInstanceFactory
アスペクトインスタンスのファクトリを返します。getAspectClassLoader
アスペクトインスタンスの ClassLoader を返します。getOrder
public int getOrder()インターフェースからコピーされた説明:Orderedこのオブジェクトの順序値を取得します。値が高いほど、優先度は低くなります。結果として、最も低い値を持つオブジェクトが最高の優先度を持ちます(サーブレット
load-on-startupの値に多少似ています)。同じ順序の値は、影響を受けるオブジェクトの任意のソート位置になります。
setAspectName
アドバイスが宣言されたアスペクトの名前(Bean)を設定します。getAspectName
インターフェースからコピーされた説明:AspectJPrecedenceInformationアドバイスが宣言されたアスペクトの名前(Bean)を返します。- 次で指定:
- インターフェース
AspectJPrecedenceInformationのgetAspectName
setDeclarationOrder
public void setDeclarationOrder(int order) アスペクト内でこのアドバイスの宣言順序を設定します。getDeclarationOrder
public int getDeclarationOrder()インターフェースからコピーされた説明:AspectJPrecedenceInformationアスペクト内のアドバイスメンバーの宣言順序を返します。- 次で指定:
- インターフェース
AspectJPrecedenceInformationのgetDeclarationOrder
setArgumentNames
引数名がわかっている場合、このアドバイスオブジェクトの作成者によって設定されます。これは、たとえば、XML またはアドバイスアノテーションで明示的に指定されていることが原因である可能性があります。
- パラメーター:
argumentNames- 引数名のコンマ区切りリスト
setArgumentNamesFromStringArray
引数名がわかっている場合、このアドバイスオブジェクトの作成者によって設定されます。これは、たとえば、XML またはアドバイスアノテーションで明示的に指定されていることが原因である可能性があります。
- パラメーター:
argumentNames- 引数名のリスト
setReturningName
setReturningNameNoCheck
引数バインディングの計算のために、返される名前をこのレベルで保持する必要があります。このメソッドにより、afterReturning アドバイスサブクラスが名前を設定できます。getDiscoveredReturningType
getDiscoveredReturningGenericType
setThrowingName
setThrowingNameNoCheck
引数バインディングの計算のために、このレベルでスロー名を保持する必要があります。このメソッドにより、afterThrowing アドバイスサブクラスで名前を設定できます。getDiscoveredThrowingType
calculateArgumentBindings
public final void calculateArgumentBindings()セットアップの一部としてできる限り多くの作業を行い、後続のアドバイス呼び出しでの引数バインディングが可能な限り高速になるようにします。最初の引数の型が JoinPoint または ProceedingJoinPoint の場合、その位置に JoinPoint を渡します(アラウンドアドバイスの場合は ProceedingJoinPoint)。
最初の引数が
JoinPoint.StaticPart型の場合、その位置にJoinPoint.StaticPartを渡します。残りの引数は、指定されたジョインポイントでポイントカット評価によってバインドされる必要があります。引数名から値へのマップを取得します。どのアドバイスパラメーターをどの引数名にバインドする必要があるかを計算する必要があります。このバインディングを決定するには、ChainOfResponsibility に配置された複数の戦略があります。
supportsProceedingJoinPoint
protected boolean supportsProceedingJoinPoint()createParameterNameDiscoverer
引数のバインドに使用する ParameterNameDiscoverer を作成します。デフォルトの実装では、
DefaultParameterNameDiscovererを作成し、特別に構成されたAspectJAdviceParameterNameDiscovererを追加します。argBinding
protected ObjectSE[] argBinding(org.aspectj.lang.JoinPoint jp, @Nullable org.aspectj.weaver.tools.JoinPointMatch jpMatch, @Nullable ObjectSE returnValue, @Nullable ThrowableSE ex) メソッド実行ジョインポイントで引数を取り、アドバイスメソッドに一連の引数を出力します。- パラメーター:
jp- 現在の JoinPointjpMatch- この実行ジョインポイントに一致したジョインポイントの一致returnValue- メソッド実行からの戻り値 (null の可能性があります)ex- メソッドの実行によってスローされた例外 (null の可能性があります)- 戻り値:
- 引数がない場合は空の配列
invokeAdviceMethod
protected ObjectSE invokeAdviceMethod(@Nullable org.aspectj.weaver.tools.JoinPointMatch jpMatch, @Nullable ObjectSE returnValue, @Nullable ThrowableSE ex) throws ThrowableSE advice メソッドを呼び出します。- パラメーター:
jpMatch- この実行ジョインポイントに一致した JoinPointMatchreturnValue- メソッド実行からの戻り値 (null の可能性があります)ex- メソッドの実行によってスローされた例外 (null の可能性があります)- 戻り値:
- 呼び出し結果
- 例外:
ThrowableSE- 呼び出しが失敗した場合
invokeAdviceMethod
protected ObjectSE invokeAdviceMethod(org.aspectj.lang.JoinPoint jp, @Nullable org.aspectj.weaver.tools.JoinPointMatch jpMatch, @Nullable ObjectSE returnValue, @Nullable ThrowableSE t) throws ThrowableSE - 例外:
ThrowableSE
invokeAdviceMethodWithGivenArgs
- 例外:
ThrowableSE
getJoinPoint
protected org.aspectj.lang.JoinPoint getJoinPoint()進行中のジョインポイントを返すためのアドバイスでオーバーライドされます。getJoinPointMatch
ディスパッチされているジョインポイントでの現在のジョインポイントの一致を取得します。getJoinPointMatch
@Nullable protected org.aspectj.weaver.tools.JoinPointMatch getJoinPointMatch(ProxyMethodInvocation pmi) toString