KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > carol > rmi > jonathan > jeremie > JeremieCarolHandler


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

28 package org.objectweb.carol.rmi.jonathan.jeremie;
29
30 import org.omg.IOP.ServiceContext JavaDoc;
31
32 import org.objectweb.jeremie.services.handler.api.Service;
33 import org.objectweb.jonathan.apis.kernel.Context;
34 import org.objectweb.jonathan.apis.kernel.JonathanException;
35
36 import org.objectweb.carol.util.configuration.ConfigurationRepository;
37
38 /**
39  * Class <code>CarolHandler</code> is the CAROL Handler for Jonathan server
40  * interception
41  * @author Guillaume Riviere (Guillaume.Riviere@inrialpes.fr)
42  * @version 1.0, 15/07/2002
43  */

44 public class JeremieCarolHandler implements Service {
45
46     private String JavaDoc name = null;
47
48     /**
49      * Builds a new Jonathan jeremie carol service handler instance.
50      * @exception JonathanException if something goes wrong.
51      */

52     public JeremieCarolHandler() throws JonathanException {
53         // do nothing
54
this.name = "jeremie";
55     }
56
57     /**
58      * Returns a request context.
59      * @return always null
60      */

61     public ServiceContext JavaDoc getRequestContext(int id, boolean r, byte[] key, Context JavaDoc k) {
62         return null;
63     }
64
65     /**
66      * Returns a reply context.
67      * @return always null
68      */

69     public ServiceContext JavaDoc getReplyContext(int id, Context JavaDoc k) {
70         return null;
71     }
72
73     /**
74      * This method is called by the services handler to let the operations
75      * related to the target service be performed on request arrival.
76      * @param context the service context of the request;
77      */

78     public void handleRequestContext(ServiceContext JavaDoc context, int id, boolean r, byte[] key, Context JavaDoc k) {
79         ConfigurationRepository.setCurrentConfiguration(ConfigurationRepository.getConfiguration(name));
80
81     }
82
83     /**
84      * This method is called by the services handler to let the operations
85      * related to the target service be performed on reply arrival.
86      * @param context the service context of the reply;
87      */

88     public void handleReplyContext(ServiceContext JavaDoc context, int id, Context JavaDoc k) {
89         // do nothing on reply
90
}
91 }
Popular Tags