KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > carol > rmi > iiop > 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.7 2005/04/07 15:07:08 benoitf Exp $
26  * --------------------------------------------------------------------------
27  */

28 package org.objectweb.carol.rmi.iiop.interceptor;
29
30 //java import
31
import org.omg.CORBA.LocalObject JavaDoc;
32 import org.omg.PortableInterceptor.ForwardRequest JavaDoc;
33 import org.omg.PortableInterceptor.ServerRequestInfo JavaDoc;
34 import org.omg.PortableInterceptor.ServerRequestInterceptor JavaDoc;
35
36 import org.objectweb.carol.util.configuration.ConfigurationRepository;
37
38 /**
39  * Class <code>ProtocolInterceptor</code> is the CAROL JNDI IIOP Interceptor
40  * for iiop protocol this interceptor mark the current thread for each call with
41  * the iiop mark
42  * @author Guillaume Riviere (Guillaume.Riviere@inrialpes.fr)
43  * @see org.omg.PortableInterceptor.ServerRequestInterceptor
44  * @version 1.0, 15/07/2002
45  */

46 public class ProtocolInterceptor extends LocalObject JavaDoc implements ServerRequestInterceptor JavaDoc {
47
48     /**
49      * interceptor name
50      */

51     private String JavaDoc interceptorName = null;
52
53     /**
54      * constructor
55      */

56     public ProtocolInterceptor() {
57         interceptorName = "protocol interceptor xxxx2";
58     }
59
60     /**
61      * Receive request context
62      * @param JServerRequestInfo the jrmp server request information
63      * @exception ForwardRequest if an exception occur with the ObjectOutput
64      */

65     public void receive_request_service_contexts(ServerRequestInfo JavaDoc jri) throws ForwardRequest JavaDoc {
66     }
67
68     /**
69      * Receive request
70      * @param JServerRequestInfo the jrmp server request information
71      * @exception ForwardRequest if an exception occur with the ObjectOutput
72      */

73     public void receive_request(ServerRequestInfo JavaDoc jri) throws ForwardRequest JavaDoc {
74         ConfigurationRepository.setCurrentConfiguration(ConfigurationRepository.getConfiguration("iiop"));
75     }
76
77     /**
78      * send reply with context
79      * @param JServerRequestInfo the jrmp server request information
80      */

81     public void send_reply(ServerRequestInfo JavaDoc jri) {
82
83     }
84
85     /**
86      * get the name of this interceptor
87      * @return name
88      */

89     public String JavaDoc name() {
90         return interceptorName;
91     }
92
93     // methods not used
94
public void send_exception(ServerRequestInfo JavaDoc jri) throws ForwardRequest JavaDoc {
95     }
96
97     public void send_other(ServerRequestInfo JavaDoc jri) throws ForwardRequest JavaDoc {
98     }
99
100     public void destroy() {
101     }
102 }
Popular Tags