[JBoss-dev] CVS update: contrib/iiop/src/main/org/jboss/proxy/compiler IIOPStubCompiler.java

2002-02-18 Thread Francisco Reverbel

  User: reverbel
  Date: 02/02/18 14:16:03

  Modified:iiop/src/main/org/jboss/proxy/compiler IIOPStubCompiler.java
  Log:
  Debugging code commented out.
  
  Revision  ChangesPath
  1.2   +11 -13
contrib/iiop/src/main/org/jboss/proxy/compiler/IIOPStubCompiler.java
  
  Index: IIOPStubCompiler.java
  ===
  RCS file: 
/cvsroot/jboss/contrib/iiop/src/main/org/jboss/proxy/compiler/IIOPStubCompiler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- IIOPStubCompiler.java 13 Feb 2002 20:21:46 -  1.1
  +++ IIOPStubCompiler.java 18 Feb 2002 22:16:03 -  1.2
  @@ -28,7 +28,7 @@
*
* @author Unknown
* @author a href=mailto:[EMAIL PROTECTED];Francisco Reverbel/a
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
*/
   public class IIOPStubCompiler
   {
  @@ -367,19 +367,17 @@
  {
 
 byte code[] = generateCode(interfaceAnalysis, superclass, stubClassName);
  -  /*   */
  -  try {
  - String fname = stubClassName;
  - fname = fname.substring(1 + fname.lastIndexOf('.')) + .class;
  - fname = /tmp/ + fname;
  - java.io.OutputStream cf = new java.io.FileOutputStream(fname);
  - cf.write(code);
  - cf.close();
  - System.err.println(wrote  + fname);
  -  } 
  -  catch(java.io.IOException ee) { 
  -  }
  -  /*   */
  +  //try {
  +  //   String fname = stubClassName;
  +  //   fname = fname.substring(1 + fname.lastIndexOf('.')) + .class;
  +  //   fname = /tmp/ + fname;
  +  //   java.io.OutputStream cf = new java.io.FileOutputStream(fname);
  +  //   cf.write(code);
  +  //   cf.close();
  +  //   System.err.println(wrote  + fname);
  +  //} 
  +  //catch(java.io.IOException ee) { 
  +  //}
 return code;
  }
  
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: contrib/iiop/src/main/org/jboss/proxy/compiler IIOPStubCompiler.java Util.java

2002-02-13 Thread Francisco Reverbel

  User: reverbel
  Date: 02/02/13 12:21:46

  Added:   iiop/src/main/org/jboss/proxy/compiler IIOPStubCompiler.java
Util.java
  Log:
  Moving IIOP stub compiler classes from the org.jboss.proxy package:
   org.jboss.proxy.IIOPStubCompiler - org.jboss.proxy.compiler.IIOPStubCompiler
   org.jboss.proxy.Util - org.jboss.proxy.compiler.Util
  
  Revision  ChangesPath
  1.1  
contrib/iiop/src/main/org/jboss/proxy/compiler/IIOPStubCompiler.java
  
  Index: IIOPStubCompiler.java
  ===
  /*
   * JBoss, the OpenSource J2EE webOS
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package org.jboss.proxy.compiler; // IIOPStubCompiler is in this package 
// because it calls some ProxyAssembler 
// methods that currently are package 
// accessible
  
  import java.lang.reflect.Method;
  import java.lang.reflect.Modifier;
  import java.rmi.RemoteException;
  
  import org.jboss.iiop.rmi.AttributeAnalysis;
  import org.jboss.iiop.rmi.ExceptionAnalysis;
  import org.jboss.iiop.rmi.InterfaceAnalysis;
  import org.jboss.iiop.rmi.OperationAnalysis;
  import org.jboss.iiop.rmi.RMIIIOPViolationException;
  import org.jboss.ejb.plugins.iiop.CDRStream;
  import org.jboss.ejb.plugins.iiop.client.DynamicStub;
  import org.jboss.ejb.plugins.iiop.client.StubStrategy;
  
  /**
   * Utility class responsible for the dynamic generation of bytecodes of
   * IIOP stub classes.
   *
   * @author Unknown
   * @author a href=mailto:[EMAIL PROTECTED];Francisco Reverbel/a
   * @version $Revision: 1.1 $
   */
  public class IIOPStubCompiler
  {
 // Constants  --
  
 /**
  * Parameter type array for codeStubStrategy.forMethod()/code 
  * invocations. 
  */
 private static final Class[] stubStrategyParams = {
String[].class, String[].class, String[].class, String.class, 
ClassLoader.class
 };
 
 /**
  * Parameter type array for codeDynamicStub.invoke()/code invocations.
  */
 private static final Class[] invokeParams = {
String.class, StubStrategy.class, Object[].class
 };
  
 /**
  * Parameter type array for
  * codeorg.omg.CORBA.ORB.object_to_string()/code invocations.
  */ 
 private static final Class[] corbaObjectParam = { 
org.omg.CORBA.Object.class 
 };
 
 /**
  * Parameter type array for a method that takes a single string parameter.
  */ 
 private static final Class[] stringParam = {  
String.class 
 };
  
 /**
  * Parameter type array for a method that takes no parameters.
  */ 
 private static final Class[] noParams = { };
  
 // Private methods 
  
 /**
  * Returns the name of the stub strategy field associated with the method 
  * whose index is codemethodIndex/code.
  */ 
 private static String strategy(int methodIndex) {
return $s + methodIndex;
 }
 
 /**
  * Returns the name of static initializer method associated with the method
  * whose index is codemethodIndex/code.
  */ 
 private static String init(int methodIndex) {
return $i + methodIndex;  
 }
  
 /**
  * Generates the code of a given method within a stub class.
  *
  * @param asm   the codeProxyAssembler/code used to assemble
  *  the method code
  * @param superclassthe superclass of the stub class within which the 
  *  method will be generated
  * @param m a codeMethod/code instance describing the
  *  method declaration by an RMI/IDL interface
  * @param idlName   a string with the method name mapped to IDL
  * @param strategyField a string with the name of the strategy field that
  *  will be associated with the generated method
  * @param initMethoda string with the name of the static initialization
  *  method that will be associated with the generated
  *  method.
  */
 private static void generateMethodCode(ProxyAssembler asm,
Class superclass,
Method m, 
String idlName, 
String strategyField, 
String initMethod)
 {
String methodName = m.getName();
Class returnType = m.getReturnType();
Class[] paramTypes = m.getParameterTypes();
Class[] exceptions = m.getExceptionTypes();
  
//