axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/utils AxisClassLoader.java
Date Mon, 30 Apr 2001 23:50:10 GMT
rubys       01/04/30 16:50:09

  Modified:    java/src/org/apache/axis/handlers RPCDispatchHandler.java
               java/src/org/apache/axis/utils AxisClassLoader.java
  Log:
  Only load classes once.
  
  Revision  Changes    Path
  1.29      +2 -1      xml-axis/java/src/org/apache/axis/handlers/RPCDispatchHandler.java
  
  Index: RPCDispatchHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/RPCDispatchHandler.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- RPCDispatchHandler.java	2001/04/30 22:56:17	1.28
  +++ RPCDispatchHandler.java	2001/04/30 23:50:06	1.29
  @@ -67,6 +67,8 @@
    */
   public class RPCDispatchHandler extends BasicHandler {
   
  +  private static AxisClassLoader cl = new AxisClassLoader();
  +
     private static final boolean DEBUG_LOG = false;
   
     public void invoke(MessageContext msgContext) throws AxisFault {
  @@ -87,7 +89,6 @@
         /* SOAPBody as an RPCBody and process it accordingly.        */
         /*************************************************************/
         int             i ;
  -      AxisClassLoader cl     = new AxisClassLoader();
         Class           cls    = cl.loadClass(clsName); 
         Object          obj    = cls.newInstance();
         Message         inMsg  = msgContext.getRequestMessage();
  
  
  
  1.4       +12 -6     xml-axis/java/src/org/apache/axis/utils/AxisClassLoader.java
  
  Index: AxisClassLoader.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/AxisClassLoader.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AxisClassLoader.java	2001/04/11 02:00:00	1.3
  +++ AxisClassLoader.java	2001/04/30 23:50:08	1.4
  @@ -68,13 +68,13 @@
    * @author Doug Davis (dug@us.ibm.com)
    */
   public class AxisClassLoader extends ClassLoader {
  -  static Hashtable list = null ;
  +  static Hashtable list = new Hashtable() ;
   
     public AxisClassLoader() {
       super();
     }
   
  -  public synchronized void registerClass( String name, String classFile )
  +  public void registerClass( String name, String classFile )
         throws FileNotFoundException, IOException
     {
       /* Load the class file the *.class file */
  @@ -91,18 +91,22 @@
       /*************************************/
       byte[] data = baos.toByteArray();
       Class  cls  = defineClass( name, data, 0, data.length );
  -    if ( list == null ) list = new Hashtable();
   
       /* And finally register it */
       /***************************/
  +    registerClass( name, cls );
  +  }
  +
  +  public synchronized void registerClass( String name, Class cls ) {
  +    /* And finally register it */
  +    /***************************/
       list.put( name, cls );
     }
   
     public synchronized void deregisterClass( String name ) {
       /* Deregister the passed in className */
       /**************************************/
  -    if ( list != null )
  -      list.remove( name);
  +    list.remove( name);
     }
   
     public Class loadClass(String name) throws ClassNotFoundException {
  @@ -118,6 +122,8 @@
       }
   
       ClassLoader cl = this.getClass().getClassLoader();
  -    return( cl.loadClass( name ) );
  +    Class cls = cl.loadClass( name );
  +    registerClass( name, cls );
  +    return cls;
     }
   };
  
  
  

Mime
View raw message