00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
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
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 }