Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

ClassContext.java

Go to the documentation of this file.
00001 /***
00002  * Jonathan: an Open Distributed Processing Environment 
00003  * Copyright (C) 1999 France Telecom R&D
00004  * 
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Lesser General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  * 
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Lesser General Public License for more details.
00014  * 
00015  * You should have received a copy of the GNU Lesser General Public
00016  * License along with this library; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018  * 
00019  * Release: 2.0
00020  *
00021  * Contact: jonathan@objectweb.org
00022  *
00023  * Author: Kathleen Milsted
00024  *
00025  * 
00026  */
00027 package org.objectweb.jeremie.tools.jrmic;
00028 
00029 import java.util.Vector;
00030 import java.io.File;
00031 
00037 public class ClassContext {
00038    
00039    String clFullName, pkgName = "", clName, genDirName;
00040    boolean inGlobalPkg = true;
00041    
00042    private static Class cl;
00043    
00044    ClassContext(String s) throws Exception {
00045       clFullName = s;
00046       int n = clFullName.lastIndexOf(".");
00047       if (n < 0) {
00048          clName = clFullName;
00049          genDirName = CompilerContext.srcDir;
00050       } else {
00051          inGlobalPkg = false;
00052          pkgName = clFullName.substring(0,n);
00053          clName = clFullName.substring(n+1);
00054          genDirName = CompilerContext.srcDir + File.separator +
00055             pkgName.replace('.',File.separatorChar);
00056       }
00057       Utils.trace("loading class " + clFullName);
00058       // load the class but don't initialize it
00059       cl = Class.forName(clFullName, false,
00060                          ClassContext.class.getClassLoader());
00061    }
00062    
00063    static Vector getRemoteInterfaces() {
00064       return Utils.getRemoteInterfaces(cl, true);
00065    }
00066 
00067    static MethodContext[] getRemoteMethodContexts() {
00068       return Utils.getRemoteMethodContexts(cl, getRemoteInterfaces());
00069    }
00070 }

Generated at Fri May 31 19:23:31 2002 for Jonathan by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001