maguro 2005/03/17 20:35:07
Modified: modules/core/src/java/org/openejb/corba/compiler
OpenORBStubGenerator.java
Log:
Improved stub generator to generate stubs in org.omg.stubs.
Revision Changes Path
1.6 +10 -11
openejb/modules/core/src/java/org/openejb/corba/compiler/OpenORBStubGenerator.java
Index: OpenORBStubGenerator.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/compiler/OpenORBStubGenerator.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- OpenORBStubGenerator.java 15 Mar 2005 05:37:01 -0000 1.5
+++ OpenORBStubGenerator.java 18 Mar 2005 01:35:07 -0000 1.6
@@ -60,16 +60,15 @@
import org.openorb.compiler.object.IdlObject;
import org.openorb.compiler.orb.Configurator;
import org.openorb.compiler.rmi.RmiCompilerProperties;
-import org.openorb.compiler.rmi.generator.Javatoidl;
import org.openorb.compiler.rmi.parser.JavaParser;
-import org.apache.geronimo.deployment.util.DeploymentUtil;
import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.GBeanInfoBuilder;
import org.apache.geronimo.gbean.GBeanLifecycle;
import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
import org.apache.geronimo.system.main.ToolsJarHack;
+import org.openejb.util.FileUtils;
import org.openejb.util.JarUtils;
@@ -114,8 +113,9 @@
try {
Thread.currentThread().setContextClassLoader(cl);
+ if (log.isDebugEnabled()) log.debug("ClassLoader: " + cl);
- TEMPDIR = DeploymentUtil.createTempDir();
+ TEMPDIR = FileUtils.createTempDirectory();
File SRCDIR = new File(TEMPDIR, "stubs");
File CLASSESDIR = new File(TEMPDIR, "stubs");
SRCDIR.mkdirs();
@@ -126,6 +126,7 @@
rcp.setM_portableHelper(true);
rcp.setM_verbose(verbose);
rcp.setM_destdir(SRCDIR);
+ rcp.setM_packageName("org.omg.stub");
rcp.getM_includeList().add(new
URL("resource:/org/openorb/idl/"));
Configurator configurator = new Configurator(new String[0],
getProps());
JavaParser parser = new JavaParser(rcp, this, null, null, null);
@@ -141,7 +142,6 @@
parser.parse_class(iface);
IdlObject compilationGraph = parser.getIdlTreeRoot();
- Javatoidl toIDL = new Javatoidl(rcp, this);
org.openejb.corba.proxy.StubGenerator sg = new
org.openejb.corba.proxy.StubGenerator(rcp, this);
@@ -149,11 +149,11 @@
for (int i = start; i < end; i++) {
IdlObject object = (IdlObject)
parser.getCompilationTree().get(i);
- toIDL.translateRMIStub(object);
+ sg.translateStub(object, "org.omg.stub");
}
- toIDL.translateRMIStub(compilationGraph);
- sg.translateData(compilationGraph, "");
+ sg.translateStub(compilationGraph, "org.omg.stub");
+ sg.translateData(compilationGraph, "org.omg.stub");
start = end;
@@ -174,7 +174,6 @@
jar.setUpdate(true);
jar.execute();
} catch (Exception e) {
- e.printStackTrace();
/**
* Convert the msg to string so that we don't try to serialize
* anything that is unserializable in a cause exception
@@ -182,7 +181,7 @@
throw new CompilerException(e.toString());
} finally {
Thread.currentThread().setContextClassLoader(savedLoader);
- DeploymentUtil.recursiveDelete(TEMPDIR);
+ FileUtils.recursiveDelete(TEMPDIR);
}
}