KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > carol > jndi > wrapping > UnicastJNDIReferenceWrapper


1 /**
2  * Copyright (C) 2005 - 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: UnicastJNDIReferenceWrapper.java,v 1.1 2005/03/15 09:57:03 benoitf Exp $
26  * --------------------------------------------------------------------------
27  */

28 package org.objectweb.carol.jndi.wrapping;
29
30 import java.rmi.Remote JavaDoc;
31 import java.rmi.RemoteException JavaDoc;
32 import java.rmi.server.UnicastRemoteObject JavaDoc;
33
34 import javax.naming.Reference JavaDoc;
35
36 import com.sun.jndi.rmi.registry.RemoteReference;
37
38 /**
39  * Class <code> JNDIReferenceWrapper </code> is the CAROL Remote Reference
40  * implementation. This implementation make the reference wrapping to/from a
41  * remote object
42  * @author Florent Benoit
43  */

44 public class UnicastJNDIReferenceWrapper extends UnicastRemoteObject JavaDoc implements Remote JavaDoc, RemoteReference {
45
46     /**
47      * <code>Reference</code> reference to wrap
48      */

49     private Reference JavaDoc reference;
50
51     /**
52      * constructor, export this object
53      * @param reference the <code>Reference</code> reference to wrap
54      * @param objectPort the port on which export objects
55      * @throws RemoteException when super class try to export the object
56      */

57     public UnicastJNDIReferenceWrapper(Reference JavaDoc reference, int objectPort) throws RemoteException JavaDoc {
58         super(objectPort);
59         this.reference = reference;
60     }
61
62     /**
63      * Get the <code>Reference</code> reference
64      * @return the <code>Reference</code> reference
65      * @throws RemoteException if the reference cannot be returned
66      */

67     public Reference JavaDoc getReference() throws RemoteException JavaDoc {
68         return reference;
69     }
70 }
Popular Tags