KickJava   Java API By Example, From Geeks To Geeks.

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


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: JInterceptorHelper.java,v 1.7 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.net.InetAddress JavaDoc;
32 import java.rmi.server.UID JavaDoc;
33
34 /**
35  * Class <code>JInterceptorHelper</code> is the CAROL JRMP Interceptor Helper
36  * this class is used by the other pakage class to manage interceptions
37  * @author Guillaume Riviere (Guillaume.Riviere@inrialpes.fr)
38  * @version 1.0, 15/07/2002
39  */

40 public abstract class JInterceptorHelper {
41
42     // int value for context propagation optimization
43
protected static final int NO_CTX = 0;
44
45     protected static final int REMOTE_CTX = 1;
46
47     protected static final int LOCAL_CTX = 2;
48
49     /**
50      * The Inet Adress
51      */

52     protected static byte[] ia = null;
53
54     /**
55      * The spaceID
56      */

57     protected static UID JavaDoc spaceID = null;
58
59     static {
60         try {
61             spaceID = new UID JavaDoc();
62             ia = InetAddress.getLocalHost().getAddress();
63         } catch (Exception JavaDoc e) {
64             e.printStackTrace();
65         }
66     }
67
68     /**
69      * @return byte [] InetAddress
70      */

71     public static byte[] getInetAddress() {
72         return ia;
73     }
74
75     /**
76      * @return space UID
77      */

78     public static UID JavaDoc getSpaceID() {
79         return spaceID;
80     }
81 }
Popular Tags