User: reverbel
  Date: 02/02/18 14:14:08

  Modified:    iiop/src/main/org/jboss/ejb/plugins/iiop/client
                        DynamicStub.java StubClassLoader.java
  Log:
  System.err calls replaced by logger calls. Some tabs removed.
  
  Revision  Changes    Path
  1.6       +21 -7     
contrib/iiop/src/main/org/jboss/ejb/plugins/iiop/client/DynamicStub.java
  
  Index: DynamicStub.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/contrib/iiop/src/main/org/jboss/ejb/plugins/iiop/client/DynamicStub.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DynamicStub.java  13 Feb 2002 20:45:33 -0000      1.5
  +++ DynamicStub.java  18 Feb 2002 22:14:07 -0000      1.6
  @@ -17,6 +17,7 @@
   import org.jboss.ejb.plugins.iiop.HandleImpl;
   import org.jboss.ejb.plugins.iiop.HomeHandleImpl;
   import org.jboss.ejb.plugins.iiop.LocalInvoker;
  +import org.jboss.logging.Logger;
   import org.jboss.proxy.compiler.InvocationHandler;
   
   /**
  @@ -33,7 +34,7 @@
    * of operation parameters.
    * 
    * @author  <a href="mailto:[EMAIL PROTECTED]";>Francisco Reverbel</a>
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.6 $
    */
   public abstract class DynamicStub 
         extends javax.rmi.CORBA.Stub
  @@ -46,6 +47,17 @@
       */
      private Object handle = null;
   
  +   // Static ------------------------------------------------------------------
  +
  +   private static final Logger logger = 
  +                           Logger.getLogger(DynamicStub.class);
  +
  +   private static void trace(String msg)
  +   {
  +      if (logger.isTraceEnabled()) 
  +         logger.trace(msg);
  +   }
  +
      // Constructor -------------------------------------------------------------
   
      /**
  @@ -94,30 +106,32 @@
                  OutputStream out = 
                     (OutputStream)_request(operationName, true);
                  stubStrategy.writeParams(out, params);
  -               //System.err.println("sent request: " + operationName);
  +               trace("sent request: " + operationName);
                  in = (InputStream)_invoke(out);
                  if (stubStrategy.isNonVoid()) {
  -                  //System.err.println("received reply");
  +                  trace("received reply");
                     return stubStrategy.readRetval(in);
                     //Object retval = stubStrategy.readRetval(in);
  -                  //System.err.println("retval: " + retval);
  +                  //trace("retval: " + retval);
                     //return retval;
                  }
                  else
                     return null;
               }
               catch (ApplicationException ex) {
  -               //System.err.println("got application exception");
  +               trace("got application exception");
                  in =(InputStream)ex.getInputStream();
                  throw stubStrategy.readException(in);
               }
               catch (RemarshalException ex) {
  -               //System.err.println("got remarshal exception");
  +               trace("got remarshal exception");
                  return invoke(operationName, stubStrategy, params);
               }
            }
            catch (SystemException ex) {
  -            //ex.printStackTrace(System.err);
  +            if (logger.isTraceEnabled()) {
  +               logger.trace("CORBA system exception in IIOP stub", ex);
  +            }
               throw Util.mapSystemException(ex);
            }
            finally {
  
  
  
  1.3       +14 -10    
contrib/iiop/src/main/org/jboss/ejb/plugins/iiop/client/StubClassLoader.java
  
  Index: StubClassLoader.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/contrib/iiop/src/main/org/jboss/ejb/plugins/iiop/client/StubClassLoader.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StubClassLoader.java      13 Feb 2002 20:45:33 -0000      1.2
  +++ StubClassLoader.java      18 Feb 2002 22:14:07 -0000      1.3
  @@ -6,6 +6,7 @@
    */
   package org.jboss.ejb.plugins.iiop.client;
   
  +import org.jboss.logging.Logger;
   import org.jboss.proxy.compiler.IIOPStubCompiler;
   
   /**
  @@ -14,12 +15,17 @@
    * Should not be necessary when the IORs contain a JAVA_CODE_BASE tag.
    *
    * @author  <a href="mailto:[EMAIL PROTECTED]";>Francisco Reverbel</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public class StubClassLoader 
         extends ClassLoader
   {
   
  +   // Static ------------------------------------------------------------------
  +
  +   private static final Logger logger = 
  +                          Logger.getLogger(StubClassLoader.class);
  +
      // Constructor -------------------------------------------------------------
      
      public StubClassLoader(ClassLoader parent)
  @@ -32,31 +38,29 @@
      protected  Class findClass(String name) 
            throws ClassNotFoundException 
      {
  -      System.err.println("findClass(" + name + ") called");
  +      logger.debug("findClass(" + name + ") called");
         if (name.endsWith("_Stub")) {
            int start = name.lastIndexOf('.') + 1;
            if (name.charAt(start) == '_') {
               String pkg = name.substring(0, start);
               String interfaceName = pkg + name.substring(start + 1, 
                                                           name.length() - 5);
  -            System.err.println("interface name " + interfaceName);
  +            logger.debug("interface name " + interfaceName);
               Class intf = loadClass(interfaceName);
  -            System.err.println("loaded class " + interfaceName);
  +            logger.debug("loaded class " + interfaceName);
   
               try {
                  byte[] code = IIOPStubCompiler.compile(intf, name);
                  
  -               System.err.println("compiled stub class for " + interfaceName);
  +               logger.debug("compiled stub class for " + interfaceName);
                  Class clz = defineClass(name, code, 0, code.length);
  -               System.err.println("defined stub class for " + interfaceName);
  +               logger.debug("defined stub class for " + interfaceName);
                  resolveClass(clz);
  -               System.err.println("resolved stub class for " + interfaceName);
  +               logger.debug("resolved stub class for " + interfaceName);
                  return clz;
               }
               catch (RuntimeException e) {
  -               System.err.println("-----------------------------------------");
  -               e.printStackTrace(System.err);
  -               System.err.println("-----------------------------------------");
  +               logger.debug("Exception generating IIOP stub " + name, e);
                  throw e;
               }
            }
  
  
  

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

Reply via email to