KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > proxy > SimpleRPCContainer


1 /**
2  *
3  * Copyright 2003-2004 The Apache Software Foundation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * 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
18 package org.apache.geronimo.proxy;
19
20 import java.util.LinkedHashMap JavaDoc;
21 import java.util.LinkedList JavaDoc;
22 import java.util.Map JavaDoc;
23 import javax.management.ObjectName JavaDoc;
24
25 import org.apache.geronimo.core.service.Interceptor;
26 import org.apache.geronimo.core.service.Invocation;
27 import org.apache.geronimo.core.service.InvocationResult;
28 import org.apache.geronimo.core.service.RPCContainer;
29
30 /**
31  * @version $Rev: 71492 $ $Date: 2004-11-14 21:31:50 -0800 (Sun, 14 Nov 2004) $
32  */

33 public class SimpleRPCContainer extends SimpleContainer implements RPCContainer {
34
35     private final Map JavaDoc plugins = new LinkedHashMap JavaDoc();
36     private final Map JavaDoc pluginObjects = new LinkedHashMap JavaDoc();
37     private final LinkedList JavaDoc interceptors = new LinkedList JavaDoc();
38     private Interceptor firstInterceptor;
39
40     public SimpleRPCContainer(Interceptor firstInterceptor) {
41         this.firstInterceptor = firstInterceptor;
42     }
43
44     /**
45     * @see org.apache.geronimo.core.service.RPCContainer#invoke(org.apache.geronimo.core.service.Invocation)
46     */

47     public final InvocationResult invoke(Invocation invocation) throws Throwable JavaDoc {
48         return firstInterceptor.invoke(invocation);
49     }
50
51     public final ObjectName JavaDoc getPlugin(String JavaDoc logicalPluginName) {
52         return (ObjectName JavaDoc) plugins.get(logicalPluginName);
53     }
54
55     public final void putPlugin(String JavaDoc logicalPluginName, ObjectName JavaDoc objectName) {
56         plugins.put(logicalPluginName, objectName);
57     }
58
59     /**
60      * @deprecated
61      */

62     public final Object JavaDoc getPluginObject(String JavaDoc logicalPluginName) {
63         return pluginObjects.get(logicalPluginName);
64     }
65
66     /**
67      * @deprecated
68      */

69     public final void putPluginObject(String JavaDoc logicalPluginName, Object JavaDoc plugin) {
70         pluginObjects.put(logicalPluginName, plugin);
71     }
72
73 }
74
Popular Tags