KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > carol > rmi > util > RmiMultiUtility


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

25
26 package org.objectweb.carol.rmi.util;
27
28 import java.io.IOException JavaDoc;
29
30 import org.objectweb.carol.rmi.iiop.util.RmiIiopUtility;
31 import org.objectweb.carol.util.configuration.ConfigurationRepository;
32
33 /**
34  * Utility class for the rmi protocols
35  *
36  * @author Benoit Pelletier
37  */

38 public class RmiMultiUtility {
39
40     /**
41      * private constructor mandatory for utilities class
42      *
43      */

44     private RmiMultiUtility() {
45     }
46
47     /**
48      * Connect a stub to an ORB
49      *
50      * @param object object to connect
51      * @throws IOException exception
52      */

53     public static void reconnectStub2Orb(Object JavaDoc object) throws IOException JavaDoc {
54
55         // get the current protocol
56
String JavaDoc protocol = ConfigurationRepository.getCurrentConfiguration().getProtocol().getName();
57
58         // iiop case
59
if (protocol.equals("iiop")) {
60             RmiIiopUtility.reconnectStub2Orb(object);
61         }
62
63         // for others protocols, nothing to do
64
}
65
66 }
Popular Tags