User: schaefera
  Date: 01/11/26 13:46:50

  Modified:    src/main/org/jboss/deployment Deployment.java Installer.java
                        J2eeDeployer.java
  Log:
  Added the next layer of the JSR-77 implementation. Right now the application
  (EAR) as well as the EJB-Module is added and removed dynamically.
  
  Revision  Changes    Path
  1.15      +11 -1     jboss/src/main/org/jboss/deployment/Deployment.java
  
  Index: Deployment.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/Deployment.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Deployment.java   2001/11/24 19:46:42     1.14
  +++ Deployment.java   2001/11/26 21:46:50     1.15
  @@ -24,7 +24,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Daniel Schulze</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Christoph G. Jung</a>
  - * @version $Revision: 1.14 $
  + * @version $Revision: 1.15 $
    */
   public class Deployment
   implements java.io.Serializable {
  @@ -56,6 +56,9 @@
       /** the connector modules */
       protected Vector connectorModules;
       
  +    /** Content of the EAR deployment descriptor **/
  +    protected String applicationDeploymentDescriptor;
  +    
       /** the manifest entry of the deployment (if any)
        *  manifest is not serializable ... is only needed
        *  at deployment time, so we mark it transient
  @@ -201,6 +204,13 @@
        */
       public Manifest getManifest() {
           return manifest;
  +    }
  +    
  +    /**
  +     * @return EAR deployment descriptor content
  +     **/
  +    public String getApplicationDeploymentDescriptor() {
  +        return applicationDeploymentDescriptor;
       }
       
       /** returns all files (URLs) that are needed to run this deployment properly */
  
  
  
  1.18      +27 -1     jboss/src/main/org/jboss/deployment/Installer.java
  
  Index: Installer.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/Installer.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Installer.java    2001/11/26 03:17:47     1.17
  +++ Installer.java    2001/11/26 21:46:50     1.18
  @@ -12,10 +12,12 @@
   import java.io.ObjectOutputStream;
   import java.io.FileInputStream;
   import java.io.InputStream;
  +import java.io.InputStreamReader;
   import java.io.OutputStream;
   import java.io.FileOutputStream;
   import java.io.IOException;
   import java.io.FileNotFoundException;
  +import java.io.StringWriter;
   import java.util.Iterator;
   import java.util.Hashtable;
   import java.util.Vector;
  @@ -36,6 +38,9 @@
   import org.jboss.logging.Logger;
   import org.jboss.metadata.XmlFileLoader;
   
  +import org.apache.log4j.Category;
  +import org.w3c.dom.Document;
  +import org.w3c.dom.Element;
   
   /** 
    * A class intended to encapsulate the complex task of making an URL pointed
  @@ -46,7 +51,7 @@
    * 
    * @author <a href="mailto:[EMAIL PROTECTED]";>Daniel Schulze</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Christoph G. Jung</a>
  - * @version $Revision: 1.17 $
  + * @version $Revision: 1.18 $
    */
   
   public class Installer
  @@ -172,6 +177,7 @@
          // reading the deployment descriptor...
          JarFile jarFile = new JarFile(localCopy);
          J2eeApplicationMetaData app = null;
  +
          try
          {
              InputStream in = 
jarFile.getInputStream(jarFile.getEntry(files[EAR_MODULE]));
  @@ -193,6 +199,26 @@
              throw new J2eeDeploymentException("unexpected error: application.xml was 
found once but not a second time?!", e);
          }
   
  +       // Read application deployment descriptor
  +       try {
  +           InputStreamReader lInput = new InputStreamReader(
  +               jarFile.getInputStream(
  +                   jarFile.getEntry( files[ EAR_MODULE ] )
  +               )
  +           );
  +           StringWriter lOutput = new StringWriter();
  +           char[] lBuffer = new char[ 1024 ];
  +           int lLength = 0;
  +           while( ( lLength = lInput.read( lBuffer ) ) > 0 ) {
  +               lOutput.write( lBuffer, 0, lLength );
  +           }
  +           d.applicationDeploymentDescriptor = lOutput.toString();
  +           lInput.close();
  +       }
  +       catch( Exception e ) {
  +           e.printStackTrace();
  +       }
  +       
          // iterating the modules and install them
          // the library url is used to root the embedded classpaths
          libraryRoot=new URL("jar:file:"+localCopy.getAbsolutePath()+"!/");
  
  
  
  1.48      +21 -6     jboss/src/main/org/jboss/deployment/J2eeDeployer.java
  
  Index: J2eeDeployer.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/J2eeDeployer.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- J2eeDeployer.java 2001/11/26 03:17:47     1.47
  +++ J2eeDeployer.java 2001/11/26 21:46:50     1.48
  @@ -60,7 +60,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Toby Allsopp</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Scott Stark</a>.
    * @author <a href="mailto:[EMAIL PROTECTED]";>Christoph G. Jung</a>.
  - * @version $Revision: 1.47 $
  + * @version $Revision: 1.48 $
    */
   
   public class J2eeDeployer
  @@ -472,7 +472,7 @@
         ObjectName lApplication = J2EEApplication.create(
            getServer(),
            _d.getName(),
  -         _d.getSourceUrl()
  +         _d.getApplicationDeploymentDescriptor()
         );
         
         // save the old classloader
  @@ -514,10 +514,19 @@
            // Call the ContainerFactory that is loaded in the JMX server
            getLog().info("about to invoke deploy on jardeployer:" + jarDeployer);
            server.invoke(jarDeployer, "deploy",
  -         new Object[]
  -         { _d.localUrl.toString(), jarUrls, moduleName },
  -         new String[]
  -         { String.class.getName(), String[].class.getName(), String.class.getName() 
} );
  +            new Object[]{
  +               _d.getName(),
  +               _d.localUrl.toString(),
  +               jarUrls,
  +               moduleName,
  +            },
  +            new String[]{
  +               String.class.getName(),
  +               String.class.getName(),
  +               String[].class.getName(),
  +               String.class.getName()
  +            }
  +         );
            
            // Deploy the web application modules
            it = _d.webModules.iterator();
  @@ -665,6 +674,12 @@
            // should only happen for tomcat (i=1)
            log.warn("Cannot find rar deployer anymore!");
         }
  +      
  +      // Destroy the appropriate JSR-77 instance
  +      J2EEApplication.destroy(
  +         getServer(),
  +         _d.getName()
  +      );
         
         if (!error.toString().equals("")) // there was at least one error...
            throw new J2eeDeploymentException("Error(s) on stopping application 
"+_d.name+":\n"+error.toString());
  
  
  

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

Reply via email to