01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: * $Header:$
18: */
19: package org.apache.beehive.netui.pageflow.interceptor;
20:
21: /**
22: * <p>
23: * Base interface for all NetUI / Page Flow interceptors. An interceptor consists of an
24: * initialization step and two blocks of code that run before and after some block of code
25: * or event that is being intercepted.
26: * </p>
27: */
28: public interface Interceptor {
29: /**
30: * Method used to initialize the interceptor.
31: *
32: * @param config the {@link InterceptorConfig} object
33: */
34: public void init(InterceptorConfig config);
35:
36: /**
37: * Method invoked during "pre" interception of some block of code / event.
38: *
39: * @param context the interception context
40: * @param chain the chain of interceptors
41: * @throws InterceptorException an exception thrown when an error occurs during interception
42: */
43: public void preInvoke(InterceptorContext context,
44: InterceptorChain chain) throws InterceptorException;
45:
46: /**
47: * Method invoked during "post" interception of some block of code / event.
48: *
49: * @param context the interceptor context
50: * @param chain the chain of interceptors
51: * @throws InterceptorException an exception thrown when an error occurs during interception
52: */
53: public void postInvoke(InterceptorContext context,
54: InterceptorChain chain) throws InterceptorException;
55: }
|