KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jodd > madvoc > interceptor > ActionInterceptorStack


1 // Copyright (c) 2003-2007, Jodd Team (jodd.sf.net). All Rights Reserved.
2

3 package jodd.madvoc.interceptor;
4
5
6 import jodd.madvoc.ActionRequest;
7 import jodd.madvoc.MadvocException;
8
9 /**
10  * Groups common interceptors, avoiding lots of classes inside
11  * an {@link jodd.madvoc.meta.InterceptedBy} annotation. It is only
12  * used for grouping, and will be not really added to the interceptors.
13  */

14 public abstract class ActionInterceptorStack implements ActionInterceptor {
15
16     private Class JavaDoc<? extends ActionInterceptor>[] interceptors;
17
18     /**
19      * Constructs an interceptor stack with the given interceptors
20      */

21     public ActionInterceptorStack(Class JavaDoc<? extends ActionInterceptor>... interceptorClasses) {
22         if (interceptorClasses.length == 0) {
23             throw new MadvocException("Empty action interceptor stack is not allowed.");
24         }
25         this.interceptors = interceptorClasses;
26     }
27
28     /**
29      * Interceptor is not used since this is just an interceptor container.
30      */

31     public final String JavaDoc intercept(ActionRequest actionRequest) throws Exception JavaDoc {
32         return null;
33     }
34
35     /**
36      * Returns an array of interceptors.
37      */

38     public Class JavaDoc<? extends ActionInterceptor>[] getInterceptors() {
39         return interceptors;
40     }
41 }
42
Popular Tags