KickJava   Java API By Example, From Geeks To Geeks.

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


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: ProtocolInterceptor.java,v 1.5 2005/04/07 15:07:08 benoitf Exp $
26  * --------------------------------------------------------------------------
27  */

28 package org.objectweb.carol.rmi.jrmp.interceptor;
29
30 //java import
31
import java.io.IOException JavaDoc;
32
33 import org.objectweb.carol.util.configuration.ConfigurationRepository;
34
35 /**
36  * Class <code>ProtocolInterceptor</code> is the CAROL JRMP Client Interceptor
37  * For protocol propagation via current thread
38  * @author Guillaume Riviere (Guillaume.Riviere@inrialpes.fr)
39  * @version 1.0, 15/07/2002
40  */

41 public class ProtocolInterceptor implements JServerRequestInterceptor {
42
43     /**
44      * interceptor name
45      */

46     private String JavaDoc interceptorName = null;
47
48     /**
49      * constructor
50      * @param String name
51      */

52     public ProtocolInterceptor() {
53         interceptorName = "protocol interceptor xxxx1";
54     }
55
56     /**
57      * get the name of this interceptor
58      * @return name
59      */

60     public String JavaDoc name() {
61         return interceptorName;
62     }
63
64     /**
65      * Receive request
66      * @param JServerRequestInfo the jrmp server request information
67      * @exception IOException if an exception occur with the ObjectOutput
68      */

69     public void receive_request(JServerRequestInfo jri) throws IOException JavaDoc {
70         ConfigurationRepository.setCurrentConfiguration(ConfigurationRepository.getConfiguration("jrmp"));
71     }
72
73     /**
74      * send reply with context
75      * @param JServerRequestInfo the jrmp server request information
76      * @exception IOException if an exception occur with the ObjectOutput
77      */

78     public void send_reply(JServerRequestInfo jri) throws IOException JavaDoc {
79         // do nothing here
80
}
81
82     public void send_exception(JServerRequestInfo jri) throws IOException JavaDoc {
83         // do nothing here
84
}
85
86     public void send_other(JServerRequestInfo jri) throws IOException JavaDoc {
87         // do nothing here
88
}
89 }
Popular Tags