KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > carol > rmi > jrmp > interceptor > JRMPInitInfoImpl


1 /**
2  * Copyright (C) 2002,2004 - INRIA (www.inria.fr)
3  *
4  * CAROL: Common Architecture for RMI ObjectWeb Layer
5  *
6  * This library is developed inside the ObjectWeb Consortium,
7  * http://www.objectweb.org
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22  * USA
23  *
24  * --------------------------------------------------------------------------
25  * $Id: JRMPInitInfoImpl.java,v 1.3 2004/09/01 11:02:41 benoitf Exp $
26  * --------------------------------------------------------------------------
27  */

28 package org.objectweb.carol.rmi.jrmp.interceptor;
29
30 //java import
31
import java.util.ArrayList JavaDoc;
32 import java.util.Iterator JavaDoc;
33
34 /**
35  * Class <code>JRMPInitInfoImpl</code> is the CAROL JRMP Initializer
36  * Implementation
37  * @see org.objectweb.carol.rmi.jrmp.interceptor.JInitInfo
38  * @author Guillaume Riviere (Guillaume.Riviere@inrialpes.fr)
39  * @version 1.0, 15/07/2002
40  */

41 public class JRMPInitInfoImpl implements JInitInfo {
42
43     /**
44      * Request Server Interceptor Hashtable
45      */

46     protected ArrayList JavaDoc serverInterceptors = new ArrayList JavaDoc();
47
48     /**
49      * Request Client Interceptor Hashtable
50      */

51     protected ArrayList JavaDoc clientInterceptors = new ArrayList JavaDoc();
52
53     /**
54      * add client interceptor
55      * @param JClientRequestInterceptor the client interceptor to add
56      */

57     public void add_client_request_interceptor(JClientRequestInterceptor interceptor) {
58         clientInterceptors.add(interceptor);
59     }
60
61     /**
62      * add server interceptor
63      * @param JServerRequestInterceptor the server interceptor to add
64      */

65     public void add_server_request_interceptor(JServerRequestInterceptor interceptor) {
66         serverInterceptors.add(interceptor);
67     }
68
69     /**
70      * get all the client interceptor
71      * @return array of ClientRequestInterceptor
72      */

73     public JClientRequestInterceptor[] getClientRequestInterceptors() {
74         JClientRequestInterceptor[] result = new JClientRequestInterceptor[clientInterceptors.size()];
75         int j = 0;
76         for (Iterator JavaDoc i = clientInterceptors.iterator(); i.hasNext();) {
77             result[j] = (JClientRequestInterceptor) i.next();
78             j++;
79         }
80         return result;
81     }
82
83     /**
84      * get all the server interceptor
85      * @return array of ServerRequestInterceptor
86      */

87     public JServerRequestInterceptor[] getServerRequestInterceptors() {
88         JServerRequestInterceptor[] result = new JServerRequestInterceptor[serverInterceptors.size()];
89         int j = 0;
90         for (Iterator JavaDoc i = serverInterceptors.iterator(); i.hasNext();) {
91             result[j] = (JServerRequestInterceptor) i.next();
92             j++;
93         }
94         return result;
95     }
96
97     public void clear() {
98         serverInterceptors.clear();
99         clientInterceptors.clear();
100     }
101 }
Popular Tags