|
FlatServe AOP Plugin 0.4 |
||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectcom.small_it_office.flatserve.aop.AspectConfig
public class AspectConfig
アスペクトの定義を保持するクラスです。
このクラスのインスタンスをConfig.addOptionalConfig(Object)
メソッドで
Configオブジェクトに格納することで、アスペクトの定義が有効になります。
アスペクトの定義は、オーバーロードされたaddAspectメソッドを使って追加します。 HTTPサービスメソッドに対して適用されるインターセプタは、定義が追加された順番どおりに実行されます。
addAspectメソッドでアスペクトに組み込むことができるインターセプタは、
AOP alliance仕様で定義されるorg.aopalliance.intercept.MethodInterceptor
および、HttpServiceMethodInterceptor
の実装クラスです。
org.aopalliance.intercept.MethodInterceptorインターフェースを実装したクラスをインターセプタとすることで、 このインターセプタの実装をFlatServe以外のAOP Alliance準拠のフレームワークで再利用することができます。 また、逆に、他のフレームワーク用に作成されたorg.aopalliance.intercept.MethodInterceptorインターフェースの実装クラスを、 FlatServe AOP Pluginで再利用することも可能です。
HttpServiceMethodInterceptor
は、AOP Alliance準拠ではありませんが、利用方法はMethodInterceptorとほぼ同等です。
MethodInterceptorと互換性はなくなりますが、サーブレットやFlatServe特有のオブジェクトを扱うことができるメリットが
あります。
Config
,
AOP allianceコンストラクタの概要 | |
---|---|
AspectConfig()
コンストラクタ。 |
メソッドの概要 | |
---|---|
void |
addAspect(HttpServiceMethodInterceptor interceptor)
アスペクトの定義を追加します。 |
void |
addAspect(HttpServiceMethodInterceptor interceptor,
java.lang.Class<?> targetServiceClass)
アスペクトの定義を追加します。 |
void |
addAspect(HttpServiceMethodInterceptor interceptor,
java.lang.String targetPackage)
アスペクトの定義を追加します。 |
void |
addAspect(org.aopalliance.intercept.MethodInterceptor interceptor)
アスペクトの定義を追加します。 |
void |
addAspect(org.aopalliance.intercept.MethodInterceptor interceptor,
java.lang.Class<?> targetServiceClass)
アスペクトの定義を追加します。 |
void |
addAspect(org.aopalliance.intercept.MethodInterceptor interceptor,
java.lang.String targetPackage)
アスペクトの定義を追加します。 |
void |
addAspectWithAnnotation(HttpServiceMethodInterceptor interceptor,
java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
アスペクトの定義を追加します。 |
void |
addAspectWithAnnotation(org.aopalliance.intercept.MethodInterceptor interceptor,
java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
アスペクトの定義を追加します。 |
java.util.List<com.small_it_office.flatserve.aop.internal.Aspect> |
getAspectList()
定義されたアスペクトのリストを返します。 |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
コンストラクタの詳細 |
---|
public AspectConfig()
メソッドの詳細 |
---|
public void addAspect(org.aopalliance.intercept.MethodInterceptor interceptor)
interceptor
- AOP alliance仕様にしたがうインターセプタpublic void addAspect(org.aopalliance.intercept.MethodInterceptor interceptor, java.lang.Class<?> targetServiceClass)
interceptor
- AOP alliance仕様にしたがうインターセプタtargetServiceClass
- 適用可能なHTTPサービスクラスpublic void addAspect(org.aopalliance.intercept.MethodInterceptor interceptor, java.lang.String targetPackage)
interceptor
- AOP alliance仕様にしたがうインターセプタtargetPackage
- 適用可能なHTTPサービスクラスのパッケージpublic void addAspectWithAnnotation(org.aopalliance.intercept.MethodInterceptor interceptor, java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
interceptor
- AOP alliance仕様にしたがうインターセプタannotation
- インターセプタを適用するHTTPサービスクラスに付与すべきアノテーションpublic void addAspect(HttpServiceMethodInterceptor interceptor)
interceptor
- HTTPサービスメソッド専用のインターセプタpublic void addAspect(HttpServiceMethodInterceptor interceptor, java.lang.Class<?> targetServiceClass)
interceptor
- HTTPサービスメソッド専用のインターセプタtargetServiceClass
- 適用可能なHTTPサービスクラスpublic void addAspect(HttpServiceMethodInterceptor interceptor, java.lang.String targetPackage)
interceptor
- HTTPサービスメソッド専用のインターセプタtargetPackage
- 適用可能なHTTPサービスクラスのパッケージpublic void addAspectWithAnnotation(HttpServiceMethodInterceptor interceptor, java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
interceptor
- TTPサービスメソッド専用のインターセプタannotation
- インターセプタを適用するHTTPサービスクラスに付与すべきアノテーションpublic java.util.List<com.small_it_office.flatserve.aop.internal.Aspect> getAspectList()
|
FlatServe AOP Plugin 0.4 |
||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |