geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject cvs commit: incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/jetty JettyWebContainer.java
Date Sun, 24 Aug 2003 10:12:46 GMT
janb        2003/08/24 03:12:46

  Modified:    modules/web/src/java/org/apache/geronimo/web
                        AbstractWebApplication.java
                        AbstractWebContainer.java WebApplication.java
                        WebContainer.java
               modules/web/src/java/org/apache/geronimo/web/jetty
                        JettyWebContainer.java
  Log:
  Teeny bit of progress, clawing our way to an understanding of deployer vs container.
  
  Revision  Changes    Path
  1.4       +42 -51    incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/AbstractWebApplication.java
  
  Index: AbstractWebApplication.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/AbstractWebApplication.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AbstractWebApplication.java	23 Aug 2003 09:38:04 -0000	1.3
  +++ AbstractWebApplication.java	24 Aug 2003 10:12:45 -0000	1.4
  @@ -80,7 +80,7 @@
    * 
    * @version $Revision$ $Date$
    */
  -public class AbstractWebApplication
  +public abstract class AbstractWebApplication
       extends AbstractComponent
       implements WebApplication
   {
  @@ -89,8 +89,8 @@
        */
       private boolean java2ClassloadingCompliance = false;
   
  -    private URI warURI = null;
       private URI webXmlURI = null;
  +
       private Document webXmlDoc = null;
       private DocumentBuilder parser = null;
   
  @@ -99,9 +99,9 @@
       private Context initialContext = null;
   
       /* --------------------------------------------------------------------------------------
*/
  -    /**
  -     * Constructor
  -     *
  +    /** Constructor
  +     * @param location uri of webapp war or dir
  +     * @param context context path for webapp
        */
       public AbstractWebApplication()
       {
  @@ -136,8 +136,11 @@
           if (getContainer() == null)
               throw new IllegalStateException("WebApplication must have a container set before
START can be called");
   
  -        // set up the JNDI context for this webapp
  -        setupENC();
  +        //probably not necessary if deployer wil do this on our behalf
  +        // set up the JNDI context for this webapp 
  +        //setupENC();
  +        
  +        //setupClassLoader();
       }
   
       /* --------------------------------------------------------------------------------------
*/
  @@ -158,17 +161,7 @@
        */
       public String[] getServlets()
       {
  -        return null;
  -    }
  -
  -    /* --------------------------------------------------------------------------------------
*/
  -    /* Get the context path of this webapp
  -     * @return
  -     * @see org.apache.geronimo.web.WebApplication#getContextName()
  -     */
  -    public String getContextPath()
  -    {
  -        // TODO
  +        Document doc = getDeploymentDescriptorDocument();
           return null;
       }
   
  @@ -209,6 +202,7 @@
        */
       public Document getDeploymentDescriptorDocument()
       {
  +        //TODO - may not be required depending on deployer interface
           try
           {
               parseWebXml();
  @@ -221,6 +215,8 @@
   
       }
   
  +
  +    //the geronimo methods may not be required, depending on the interface to the deployer
       public URI getGeronimoDeploymentDescriptorURI()
       {
           return geronimoXmlURI;
  @@ -236,15 +232,8 @@
           //TODO
           return null;
       }
  -    /* --------------------------------------------------------------------------------------
*/
  -    /* Get the URI of the webapp itself
  -     * @return
  -     * @see org.apache.geronimo.web.WebApplication#getURI()
  -     */
  -    public URI getURI()
  -    {
  -        return warURI;
  -    }
  +  
  +  
       /* --------------------------------------------------------------------------------------
*/
       /** Setter for classloading compliance. If true, then classloading will
        * delegate first to parent classloader a la Java2 spec. If false, then
  @@ -292,28 +281,30 @@
           geronimoXmlDoc = parser.parse(geronimoXmlURI.toString());
       }
   
  -    protected void setupENC() throws Exception
  -    {
  -        //parse the standard descriptor
  -        parseWebXml();
  -
  -        //parse the geronimo web descriptor?
  -        parseGeronimoXml();
  -
  -        //create the java:comp/env context
  -        Context enc = null;
  -        
  -        //populate the resources
  -
  -        //populate the ejbs
  -
  -        //populate the UserTransaction
  -        enc.bind ("UserTransaction",  new LinkRef ("javax.transaction.UserTransaction"));
  -        
  -        //populate the security
  -
  -        //secure the context as read-only (if necessary)
  -
  -    }
  +    /*
  +        protected void setupENC() throws Exception
  +        {
  +            //parse the standard descriptor
  +            parseWebXml();
  +    
  +            //parse the geronimo web descriptor?
  +            parseGeronimoXml();
  +    
  +            //create the java:comp/env context
  +            Context enc = null;
  +            
  +            //populate the resources
  +    
  +            //populate the ejbs
  +    
  +            //populate the UserTransaction
  +            enc.bind ("UserTransaction",  new LinkRef ("javax.transaction.UserTransaction"));
  +            
  +            //populate the security
  +    
  +            //secure the context as read-only (if necessary)
  +    
  +        }
  +        */
   
   }
  
  
  
  1.5       +36 -11    incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/AbstractWebContainer.java
  
  Index: AbstractWebContainer.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/AbstractWebContainer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractWebContainer.java	23 Aug 2003 22:06:23 -0000	1.4
  +++ AbstractWebContainer.java	24 Aug 2003 10:12:45 -0000	1.5
  @@ -72,7 +72,7 @@
    *
    * @version $Revision$ $Date$
    */
  -public class AbstractWebContainer
  +public abstract class AbstractWebContainer
       extends AbstractContainer
       implements WebContainer
   {
  @@ -120,11 +120,36 @@
       * @param url the location of the web application to deploy
       * @throws Exception
       * @see org.apache.geronimo.web.WebContainer#deploy(java.lang.String)
  +    * @todo this is likely to change when the deployment interface becomes available
       */
  -    public void deploy(String url) throws Exception
  +    public void deploy(String uri) throws Exception
       {
  +        //TODO what will be the interface to the deployer?
  +        
  +        //sort out the contextPath  - if the geronimo web descriptor doesn't
  +        //provide one, and there is no application descriptor, then it will be
  +        //the name of the webapp. NOTE, we need to somehow access
  +        //these descriptors - is it by JSR88 beans or by xml?
  +        String contextPath = null;
  +        
  +        //this is only necessary for compilation, the interface to the deployer will change
  +        URI location = new URI(uri);
  +        
  +        WebApplication webapp = createWebApplication ();
  +        webapp.setURI(location);
  +        webapp.setContextPath(contextPath);
  +        addComponent (webapp);
       }
   
  +
  +    /* --------------------------------------------------------------------------------------
*/
  +    /** Create a WebApplication suitable to the container's type.
  +     * @return WebApplication instance, preferably derived from AbstractWebApplication
suitable to the container
  +     */
  +    public abstract WebApplication createWebApplication ();
  +    
  +    
  +    
       /* --------------------------------------------------------------------------------------
*/
       /**
        * Get the URI of the web defaults.
  @@ -171,20 +196,20 @@
        * @return
        * @see org.apache.geronimo.web.WebContainer#getUnpackWars()
        */
  -    public boolean getUnpackWars()
  -    {
  -        return unpackWars;
  -    }
  +    //public boolean getUnpackWars()
  +    //{
  +    //    return unpackWars;
  +    //}
   
       /* --------------------------------------------------------------------------------------
*/
       /* 
        * @param state
        * @see org.apache.geronimo.web.WebContainer#setUnpackWars(boolean)
        */
  -    public void setUnpackWars(boolean state)
  -    {
  -        unpackWars = state;
  -    }
  +    //public void setUnpackWars(boolean state)
  +    //{
  +    //    unpackWars = state;
  +    //}
   
       /* --------------------------------------------------------------------------------------
*/
       /* Add a component to this container's containment hierarchy
  
  
  
  1.4       +6 -1      incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/WebApplication.java
  
  Index: WebApplication.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/WebApplication.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- WebApplication.java	23 Aug 2003 09:38:04 -0000	1.3
  +++ WebApplication.java	24 Aug 2003 10:12:46 -0000	1.4
  @@ -79,6 +79,9 @@
        */
       public URI getURI();
       
  +    public void setURI(URI uri);
  +    
  +    
       /*--------------------------------------------------------------------------------
*/
       /** JSR077 WebModule method to expose the
        * names of all servlets contained within this webapp.
  @@ -88,6 +91,8 @@
       public String[] getServlets();
       
       public String getContextPath();
  +    
  +    public void setContextPath(String path);
       
       public String getDeploymentDescriptor();
       
  
  
  
  1.3       +7 -3      incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/WebContainer.java
  
  Index: WebContainer.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/WebContainer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- WebContainer.java	23 Aug 2003 09:38:04 -0000	1.2
  +++ WebContainer.java	24 Aug 2003 10:12:46 -0000	1.3
  @@ -78,6 +78,8 @@
       */
       public void deploy(String uri) throws Exception;
   
  +
  +
       /*--------------------------------------------------------------------------------
*/
       /** Set up a web.xml descriptor for the Container to use as
        * defaults.
  @@ -104,14 +106,16 @@
       /* --------------------------------------------------------------------------------------
*/
       /** Control if wars will be unpacked to temporary location or not
        * @param state
  +     * @todo this might be handled by the deployer instead
        */
  -    public void setUnpackWars (boolean state);
  +    //public void setUnpackWars (boolean state);
       
       /* --------------------------------------------------------------------------------------
*/
       /**Getter for whether wars will be unpacked to temporary location or not
        * @return
  +     * @todo this might be handled by the deployer instead
        */
  -    public boolean getUnpackWars ();
  +    //public boolean getUnpackWars ();
       
   
   }
  
  
  
  1.2       +10 -1     incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/jetty/JettyWebContainer.java
  
  Index: JettyWebContainer.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/web/src/java/org/apache/geronimo/web/jetty/JettyWebContainer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JettyWebContainer.java	20 Aug 2003 05:37:03 -0000	1.1
  +++ JettyWebContainer.java	24 Aug 2003 10:12:46 -0000	1.2
  @@ -55,7 +55,10 @@
   */
   package org.apache.geronimo.web.jetty;
   
  +import java.net.URI;
  +
   import org.apache.geronimo.web.AbstractWebContainer;
  +import org.apache.geronimo.web.WebApplication;
   import org.mortbay.jetty.Server;
   
   /**
  @@ -64,4 +67,10 @@
    * @version $Revision$ $Date$
    */
   public class JettyWebContainer extends AbstractWebContainer {
  +    
  +    public WebApplication createWebApplication ()
  +    {
  +        //TODO
  +        return null;
  +    }
   }
  
  
  

Mime
View raw message