001    /*
002    
003      Copyright (C) 2001 Lionel Seinturier
004    
005      This program is free software; you can redistribute it and/or modify
006      it under the terms of the GNU Lesser General Public License as
007      published by the Free Software Foundation; either version 2 of the
008      License, or (at your option) any later version.
009    
010      This program is distributed in the hope that it will be useful,
011      but WITHOUT ANY WARRANTY; without even the implied warranty of
012      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013      GNU Lesser General Public License for more details.
014    
015      You should have received a copy of the GNU Lesser Generaly Public License
016      along with this program; if not, write to the Free Software
017      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
018    
019    package org.objectweb.jac.core.dist.rmi;
020    
021    import org.objectweb.jac.core.dist.RemoteContainer;
022    import org.objectweb.jac.core.dist.RemoteRef;
023    
024    
025    /**
026     * RMIRemoteRef stores the reference of a remote object
027     * that can be accessed by the RMI protocol.
028     *
029     * @author <a href="http://www-src.lip6.fr/homepages/Lionel.Seinturier/index-eng.html">Lionel Seinturier</a>
030     */
031     
032    public class RMIRemoteRef extends RemoteRef {
033    
034       /**
035        * Default constructor. */
036    
037       public RMIRemoteRef() {}
038    
039       /**
040        * This is a full constructor for RemoteRef.
041        *
042        * @param remCont   the ref of the container that handles the remote object.
043        * @param remIndex  the index of the remote object
044        */
045        
046       public RMIRemoteRef(RemoteContainer remCont, int remIndex) {
047          super(remCont, remIndex);
048       }
049       
050       
051       /**
052        * This is a more friendly constructor for RemoteRef.
053        *
054        * @param remCont   the name of the container that handles the remote object.
055        * @param remIndex  the index of the remote object.
056        */   
057       public RMIRemoteRef(String remCont, int remIndex) {
058          super(remCont, remIndex);
059       }
060    
061       /**
062        * This method resolves a container from a container name.
063        * This method simply delegates its job to a RMIRemoteContainer.
064        *
065        * @param contName  the name of the container
066        * @return          the container reference
067        */
068       
069       public RemoteContainer resolve( String contName ) {
070          return RMINaming.resolve(contName);  
071       }
072    
073       /**
074        * This method re-gets the reference of a remote container.
075        * CORBA do not linearalize remote references in a standard way.
076        * Thus a remote reference may need to be adapted whenever it is transmitted.
077        *
078        * This method performs nothing in the case of RMI.
079        * This method is called when a remote reference
080        * is received by a RemoteContainer.
081        *
082        * @return  the container reference
083        */
084       
085       public RemoteContainer reresolve() { return null; }
086       
087    }