クラス AbstractAspectJAdvice

java.lang.ObjectSE
org.springframework.aop.aspectj.AbstractAspectJAdvice
実装されたすべてのインターフェース:
SerializableSEAdviceAspectJPrecedenceInformationOrdered
既知の直属サブクラス
AspectJAfterAdviceAspectJAfterReturningAdviceAspectJAfterThrowingAdviceAspectJAroundAdviceAspectJMethodBeforeAdvice

public abstract class AbstractAspectJAdvice extends ObjectSE implements Advice, AspectJPrecedenceInformation, SerializableSE
AspectJ アスペクトまたは AspectJ アノテーション付きアドバイスメソッドをラップする AOPAlliance Advice クラスの基本クラス。
導入:
2.0
作成者:
Rod Johnson, Adrian Colyer, Juergen Hoeller, Ramnivas Laddad
関連事項:
  • フィールドの詳細

    • JOIN_POINT_KEY

      protected static final StringSE JOIN_POINT_KEY
      現在のジョインポイントの ReflectiveMethodInvocation userAttributes マップで使用されるキー。
    • aspectJAdviceMethod

      protected transient MethodSE 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

      public final MethodSE getAspectJAdviceMethod()
      AspectJ スタイルのアドバイスメソッドを返します。
    • getPointcut

      public final AspectJExpressionPointcut getPointcut()
      AspectJ 式のポイントカットを返します。
    • buildSafePointcut

      public final Pointcut buildSafePointcut()
      AspectJ アドバイスメソッド自体を除外する「安全な」ポイントカットを作成します。
      戻り値:
      元の AspectJ 式のポイントカット上に構築される構成可能なポイントカット
      関連事項:
    • getAspectInstanceFactory

      public final AspectInstanceFactory getAspectInstanceFactory()
      アスペクトインスタンスのファクトリを返します。
    • getAspectClassLoader

      @Nullable public final ClassLoaderSE getAspectClassLoader()
      アスペクトインスタンスの ClassLoader を返します。
    • getOrder

      public int getOrder()
      インターフェースからコピーされた説明: Ordered
      このオブジェクトの順序値を取得します。

      値が高いほど、優先度は低くなります。結果として、最も低い値を持つオブジェクトが最高の優先度を持ちます(サーブレット load-on-startup の値に多少似ています)。

      同じ順序の値は、影響を受けるオブジェクトの任意のソート位置になります。

      次で指定:
      インターフェース OrderedgetOrder 
      戻り値:
      オーダー額
      関連事項:
    • setAspectName

      public void setAspectName(StringSE name)
      アドバイスが宣言されたアスペクトの名前(Bean)を設定します。
    • getAspectName

      public StringSE getAspectName()
      インターフェースからコピーされた説明: AspectJPrecedenceInformation
      アドバイスが宣言されたアスペクトの名前(Bean)を返します。
      次で指定:
      インターフェース AspectJPrecedenceInformationgetAspectName 
    • setDeclarationOrder

      public void setDeclarationOrder(int order)
      アスペクト内でこのアドバイスの宣言順序を設定します。
    • getDeclarationOrder

      public int getDeclarationOrder()
      インターフェースからコピーされた説明: AspectJPrecedenceInformation
      アスペクト内のアドバイスメンバーの宣言順序を返します。
      次で指定:
      インターフェース AspectJPrecedenceInformationgetDeclarationOrder 
    • setArgumentNames

      public void setArgumentNames(StringSE argumentNames)
      引数名がわかっている場合、このアドバイスオブジェクトの作成者によって設定されます。

      これは、たとえば、XML またはアドバイスアノテーションで明示的に指定されていることが原因である可能性があります。

      パラメーター:
      argumentNames - 引数名のコンマ区切りリスト
    • setArgumentNamesFromStringArray

      public void setArgumentNamesFromStringArray(StringSE... argumentNames)
      引数名がわかっている場合、このアドバイスオブジェクトの作成者によって設定されます。

      これは、たとえば、XML またはアドバイスアノテーションで明示的に指定されていることが原因である可能性があります。

      パラメーター:
      argumentNames - 引数名のリスト
    • setReturningName

      public void setReturningName(StringSE name)
    • setReturningNameNoCheck

      protected void setReturningNameNoCheck(StringSE name)
      引数バインディングの計算のために、このレベルで返される名前を保持する必要があります。このメソッドでは、afterReturning アドバイスサブクラスが名前を設定できます。
    • getDiscoveredReturningType

      protected ClassSE<?> getDiscoveredReturningType()
    • getDiscoveredReturningGenericType

      @Nullable protected TypeSE getDiscoveredReturningGenericType()
    • setThrowingName

      public void setThrowingName(StringSE name)
    • setThrowingNameNoCheck

      protected void setThrowingNameNoCheck(StringSE name)
      引数バインディング計算のために、このレベルでスローする名前を保持する必要があります。このメソッドは、afterThrowing アドバイスサブクラスが名前を設定できるようにします。
    • getDiscoveredThrowingType

      protected ClassSE<?> getDiscoveredThrowingType()
    • calculateArgumentBindings

      public final void calculateArgumentBindings()
      セットアップの一部としてできる限り多くの作業を行い、後続のアドバイス呼び出しでの引数バインディングが可能な限り高速になるようにします。

      最初の引数の型が JoinPoint または ProceedingJoinPoint の場合、その位置に JoinPoint を渡します(アラウンドアドバイスの場合は ProceedingJoinPoint)。

      最初の引数が JoinPoint.StaticPart 型の場合、その位置に JoinPoint.StaticPart を渡します。

      残りの引数は、指定されたジョインポイントでポイントカット評価によってバインドされる必要があります。引数名から値へのマップを取得します。どのアドバイスパラメーターをどの引数名にバインドする必要があるかを計算する必要があります。このバインディングを決定するには、ChainOfResponsibility に配置された複数の戦略があります。

    • supportsProceedingJoinPoint

      protected boolean supportsProceedingJoinPoint()
    • createParameterNameDiscoverer

      protected ParameterNameDiscoverer 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 - 現在の JoinPoint
      jpMatch - この実行ジョインポイントに一致したジョインポイントの一致
      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 - この実行ジョインポイントに一致した JoinPointMatch
      returnValue - メソッド実行からの戻り値 (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

      protected ObjectSE invokeAdviceMethodWithGivenArgs(ObjectSE[] args) throws ThrowableSE
      例外:
      ThrowableSE
    • getJoinPoint

      protected org.aspectj.lang.JoinPoint getJoinPoint()
      進行中のジョインポイントを返すためのアドバイスでオーバーライドされます。
    • getJoinPointMatch

      @Nullable protected org.aspectj.weaver.tools.JoinPointMatch getJoinPointMatch()
      ディスパッチされているジョインポイントでの現在のジョインポイントの一致を取得します。
    • getJoinPointMatch

      @Nullable protected org.aspectj.weaver.tools.JoinPointMatch getJoinPointMatch(ProxyMethodInvocation pmi)
    • toString

      public StringSE toString()
      オーバーライド:
      クラス ObjectSEtoString