KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jac > core > dist > rmi > RMIRemoteRef


1 /*
2
3   Copyright (C) 2001 Lionel Seinturier
4
5   This program is free software; you can redistribute it and/or modify
6   it under the terms of the GNU Lesser General Public License as
7   published by the Free Software Foundation; either version 2 of the
8   License, or (at your option) any later version.
9
10   This program is distributed in the hope that it will be useful,
11   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13   GNU Lesser General Public License for more details.
14
15   You should have received a copy of the GNU Lesser Generaly Public License
16   along with this program; if not, write to the Free Software
17   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */

18
19 package org.objectweb.jac.core.dist.rmi;
20
21 import org.objectweb.jac.core.dist.RemoteContainer;
22 import org.objectweb.jac.core.dist.RemoteRef;
23
24
25 /**
26  * RMIRemoteRef stores the reference of a remote object
27  * that can be accessed by the RMI protocol.
28  *
29  * @author <a HREF="http://www-src.lip6.fr/homepages/Lionel.Seinturier/index-eng.html">Lionel Seinturier</a>
30  */

31  
32 public class RMIRemoteRef extends RemoteRef {
33
34    /**
35     * Default constructor. */

36
37    public RMIRemoteRef() {}
38
39    /**
40     * This is a full constructor for RemoteRef.
41     *
42     * @param remCont the ref of the container that handles the remote object.
43     * @param remIndex the index of the remote object
44     */

45     
46    public RMIRemoteRef(RemoteContainer remCont, int remIndex) {
47       super(remCont, remIndex);
48    }
49    
50    
51    /**
52     * This is a more friendly constructor for RemoteRef.
53     *
54     * @param remCont the name of the container that handles the remote object.
55     * @param remIndex the index of the remote object.
56     */

57    public RMIRemoteRef(String JavaDoc remCont, int remIndex) {
58       super(remCont, remIndex);
59    }
60
61    /**
62     * This method resolves a container from a container name.
63     * This method simply delegates its job to a RMIRemoteContainer.
64     *
65     * @param contName the name of the container
66     * @return the container reference
67     */

68    
69    public RemoteContainer resolve( String JavaDoc contName ) {
70       return RMINaming.resolve(contName);
71    }
72
73    /**
74     * This method re-gets the reference of a remote container.
75     * CORBA do not linearalize remote references in a standard way.
76     * Thus a remote reference may need to be adapted whenever it is transmitted.
77     *
78     * This method performs nothing in the case of RMI.
79     * This method is called when a remote reference
80     * is received by a RemoteContainer.
81     *
82     * @return the container reference
83     */

84    
85    public RemoteContainer reresolve() { return null; }
86    
87 }
88
Popular Tags