User: fleury  
  Date: 00/05/28 12:39:01

  Modified:    src/main/org/jboss/ejb/deployment jBossFileManager.java
  Log:
  Dude! let's put some comments on the implicit stuff...
  
  Revision  Changes    Path
  1.6       +20 -6     jboss/src/main/org/jboss/ejb/deployment/jBossFileManager.java
  
  Index: jBossFileManager.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/deployment/jBossFileManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- jBossFileManager.java     2000/05/22 15:03:02     1.5
  +++ jBossFileManager.java     2000/05/28 19:39:01     1.6
  @@ -30,7 +30,8 @@
    *      
    *   @see <related>
    *   @author Rickard �berg ([EMAIL PROTECTED])
  - *   @version $Revision: 1.5 $
  + *   @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
  + *   @version $Revision: 1.6 $
    */
   public class jBossFileManager
      extends BeanContextServicesSupport
  @@ -63,6 +64,13 @@
         return ejbJar;
      }
   
  +     /*
  +     * load(URL file)
  +     *
  +     * This method creates the jBossEjbJar that encapsulates the MetaData for the 
container
  +     * if no proper jboss.xml and jaws.xml are found the system ones are used 
  +     *
  +     */
      public jBossEjbJar load(URL file)
         throws Exception
      {
  @@ -70,9 +78,13 @@
         // Create classloader
         {
            URL fileUrl = file;
  -         if (fileUrl.toString().endsWith("ejb-jar.xml"))
  +         if (fileUrl.toString().endsWith("ejb-jar.xml")) {
  +                      
  +                     // fileURL points to the top of the directory of the beans
               fileUrl = new 
File(fileUrl.getFile()).getParentFile().getParentFile().toURL();
  -            
  +              }  
  +              
  +              // The classLoader has visibility on all the classes in this directory
            cl = new URLClassLoader(new URL[] { fileUrl }, 
Thread.currentThread().getContextClassLoader());
         }
            
  @@ -100,14 +112,15 @@
               ejbJar.importXml(doc.getDocumentElement());
            } catch (IOException e)
            {
  -            // Couldn't find jboss.xml.. that's ok!            // Load default 
jBoss XML
  +            // Couldn't find jboss.xml.. that's ok!            
  +                     // Load default jBoss XML
               InputStream jbossXml = 
getClass().getResourceAsStream("defaultjboss.xml");
               if (jbossXml == null)
               {
                  // No default found
                  return ejbJar;
               }
  -            in = new BufferedReader(new InputStreamReader(jbossXml));
  +                     in = new BufferedReader(new InputStreamReader(jbossXml));
               doc = xm.load(in);
               in.close();
               
  @@ -176,10 +189,11 @@
                  // No default found
                  return ejbJar;
               }
  +                     
               in = new BufferedReader(new InputStreamReader(jbossXml));
               doc = xm.load(in);
               in.close();
  -            
  + 
               ejbJar.importXml(doc.getDocumentElement());
               return ejbJar;
            }
  
  
  

Reply via email to