Package nablarch.fw
Class Interceptor.Impl<TData,TResult,T extends Annotation>  
java.lang.Object
nablarch.fw.Interceptor.Impl<TData,TResult,T>  
- All Implemented Interfaces:
- Handler<TData,,- TResult> - HandlerWrapper<TData,- TResult> 
- Direct Known Subclasses:
- CheckRole.Impl,- ErrorOnSessionWriteConflict.Impl,- InjectForm.Impl,- OnDoubleSubmission.Impl,- OnError.Impl,- OnErrors.Impl,- Transactional.TransactionalImpl,- UseToken.Impl
- Enclosing class:
- Interceptor
public abstract static class Interceptor.Impl<TData,TResult,T extends Annotation>  
extends Object
implements HandlerWrapper<TData,TResult> 
Interceptorの処理内容を実装するクラスの抽象基底クラスとなるリクエストハンドラ。
 
 各インターセプションが付与されたときに行われるインターセプト処理の内容は、
 このクラスを継承して作成する。
 
 各Interceptorの値に指定されるクラスは、このクラスのサブクラスであり、
 インターセプトが行われると、そのサブクラスが実装するHandler.handle(Object, ExecutionContext)に処理が委譲される。
 この際、ラップされる前のリクエストハンドラをgetOriginalHandler()で取得できるので、
 各インターセプタ固有の処理を以下の例のように実装することができる。
 
 public HttpResponse handle(HttpRequest req, ExecutionContext ctx) {
     try {
         doBeforeAdvice(); // インターセプタによる前処理
         return getOriginalHandler().handle(req, ctx); // 本処理
     } catch(RuntimeException e) {
         doErrorHandling();  // インターセプタによる例外ハンドリング
         throw e;
     } finally {
         doAfterAdvice();  // インターセプタによる終端処理
     }
 }
 - 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetDelegates(TData data, ExecutionContext context) このラッパーが処理を移譲するオブジェクトのリストを返す。 対象となるオブジェクトが存在しない場合は空の配列を返す。処理対象のInterceptorを取得する。インターセプト対象のリクエストハンドラを取得する。voidsetInterceptor(Annotation annotation) 処理対象のInterceptorを設定する。voidsetOriginalHandler(Handler<TData, TResult> originalHandler) インターセプト対象のリクエストハンドラを設定する。
- 
Constructor Details- 
Impl
 
- 
- 
Method Details- 
setInterceptor処理対象のInterceptorを設定する。- Parameters:
- annotation- このクラスが実装する- Interceptor
 
- 
getInterceptor処理対象のInterceptorを取得する。- Returns:
- 処理対象のInterceptorを取得する。
 
- 
getOriginalHandlerインターセプト対象のリクエストハンドラを取得する。- Returns:
- インターセプト対象のリクエストハンドラ
 
- 
setOriginalHandlerインターセプト対象のリクエストハンドラを設定する。- Parameters:
- originalHandler- インターセプト対象のリクエストハンドラ
 
- 
getDelegatesこのラッパーが処理を移譲するオブジェクトのリストを返す。 対象となるオブジェクトが存在しない場合は空の配列を返す。- Specified by:
- getDelegatesin interface- HandlerWrapper<TData,- TResult> 
- Parameters:
- data- ハンドラに対する入力データ
- context- 実行コンテキスト
- Returns:
- 内包するオブジェクト。
 
 
-