Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: jac/core/dist/rmi/RMIRemoteRef.java


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 jac.core.dist.rmi;
20  
21  import jac.core.dist.RemoteContainer;
22  import 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   * @version 0.8.1
30   * @author <a href="http://www-src.lip6.fr/homepages/Lionel.Seinturier/index-eng.html">Lionel Seinturier</a>
31   */
32   
33  public class RMIRemoteRef extends RemoteRef {
34  
35     /**
36      * Default constructor. */
37  
38     public RMIRemoteRef () {}
39  
40     /**
41      * This is a full constructor for RemoteRef.
42      *
43      * @param remCont   the ref of the container that handles the remote object.
44      * @param remIndex  the index of the remote object
45      */
46      
47     public RMIRemoteRef(  RemoteContainer remCont, int remIndex ) {
48        super( remCont, remIndex );
49     }
50     
51     
52     /**
53      * This is a more friendly constructor for RemoteRef.
54      *
55      * @param remCont   the name of the container that handles the remote object.
56      * @param remIndex  the index of the remote object.
57      */
58     
59     public RMIRemoteRef( String contName, int remIndex ) {
60        super( contName, remIndex );
61     }
62  
63     /**
64      * This method resolves a container from a container name.
65      * This method simply delegates its job to a RMIRemoteContainer.
66      *
67      * @param contName  the name of the container
68      * @return          the container reference
69      */
70     
71     public RemoteContainer resolve( String contName ) {
72     
73        return RMINaming.resolve(contName);  
74     }
75     
76  
77     /**
78      * This method re-gets the reference of a remote container.
79      * CORBA do not linearalize remote references in a standard way.
80      * Thus a remote reference may need to be adapted whenever it is transmitted.
81      *
82      * This method performs nothing in the case of RMI.
83      * This method is called when a remote reference
84      * is received by a RemoteContainer.
85      *
86      * @return  the container reference
87      */
88     
89     public RemoteContainer reresolve() { return null; }
90     
91  }