KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > InterceptorStack


1 // Copyright 2004, 2005 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.hivemind;
16
17 import org.apache.commons.logging.Log;
18 import org.apache.hivemind.internal.Module;
19
20 /**
21  * Used when constructing an interceptor stack around
22  * a service implementation instance.
23  *
24  * @author Howard Lewis Ship
25  */

26 public interface InterceptorStack
27 {
28     /**
29      * Return the full id of the service extension point for which
30      * interceptors are being fabricated.
31      */

32     
33     public String JavaDoc getServiceExtensionPointId();
34     
35     /**
36      * Returns the module which contains the service extension point.
37      */

38     
39     public Module getServiceModule();
40     
41     /**
42      * Returns the interface for the service; the same
43      * as {@link org.apache.hivemind.internal.ServicePoint#getServiceInterface()}.
44      */

45     public Class JavaDoc getServiceInterface();
46     
47     /**
48      * Returns the current top object on the stack.
49      */

50     public Object JavaDoc peek();
51     
52     /**
53      * Pushes a new instance onto the stack. The new instance
54      * should be a wrapper around {@link #peek()}, and should
55      * implement the service extension point's interface.
56      *
57      * <p>The stack checks that the interceptor is not null,
58      * and that the interceptor implements the service interface.
59      */

60     
61     public void push(Object JavaDoc interceptor);
62     
63     /**
64      * Returns the Log instance that should be used to log any information
65      * about the service, or the construction of the service.
66      */

67     
68     public Log getServiceLog();
69 }
70
Popular Tags