You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by ke...@apache.org on 2005/09/29 23:36:54 UTC

svn commit: r292559 - in /jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus: ./ internal/server/ server/

Author: kenney
Date: Thu Sep 29 14:36:43 2005
New Revision: 292559

URL: http://svn.apache.org/viewcvs?rev=292559&view=rev
Log:
Decoupled share-12-13-14 from Wrapper implementations using reflection
(a newInstance method in the AbstractXXXWrapper).

Updated Wrapper-implementation references to use the Abstract base class.

Modified:
    jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/JspTestCase.java
    jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/ServletTestCase.java
    jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/internal/server/JspTestCaller.java
    jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/internal/server/ServletTestCaller.java
    jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/AbstractHttpServletRequestWrapper.java
    jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/AbstractPageContextWrapper.java
    jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/AbstractServletConfigWrapper.java
    jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/AbstractServletContextWrapper.java
    jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/RequestDispatcherWrapper.java

Modified: jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/JspTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/JspTestCase.java?rev=292559&r1=292558&r2=292559&view=diff
==============================================================================
--- jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/JspTestCase.java (original)
+++ jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/JspTestCase.java Thu Sep 29 14:36:43 2005
@@ -25,7 +25,7 @@
 
 import org.apache.cactus.internal.client.connector.http.HttpProtocolHandler;
 import org.apache.cactus.internal.configuration.DefaultJspConfiguration;
-import org.apache.cactus.server.PageContextWrapper;
+import org.apache.cactus.server.AbstractPageContextWrapper;
 import org.apache.cactus.spi.client.connector.ProtocolHandler;
 
 /**
@@ -44,7 +44,7 @@
      * <code>beginXXX()</code> or <code>endXXX()</code> methods it will
      * have the <code>null</code> value.
      */
-    public PageContextWrapper pageContext;
+    public AbstractPageContextWrapper pageContext;
 
     /**
      * Valid <code>JspWriter</code> object that you can access from

Modified: jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/ServletTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/ServletTestCase.java?rev=292559&r1=292558&r2=292559&view=diff
==============================================================================
--- jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/ServletTestCase.java (original)
+++ jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/ServletTestCase.java Thu Sep 29 14:36:43 2005
@@ -28,7 +28,8 @@
 import org.apache.cactus.internal.CactusTestCase;
 import org.apache.cactus.internal.client.connector.http.HttpProtocolHandler;
 import org.apache.cactus.internal.configuration.DefaultServletConfiguration;
-import org.apache.cactus.server.ServletConfigWrapper;
+import org.apache.cactus.server.AbstractHttpServletRequestWrapper;
+import org.apache.cactus.server.AbstractServletConfigWrapper;
 import org.apache.cactus.spi.client.connector.ProtocolHandler;
 
 /**
@@ -48,7 +49,7 @@
      * <code>beginXXX()</code> or <code>endXXX()</code> methods it will
      * have the <code>null</code> value.
      */
-    public org.apache.cactus.server.HttpServletRequestWrapper request;
+    public AbstractHttpServletRequestWrapper request;
 
     /**
      * Valid <code>HttpServletResponse</code> object that you can access from
@@ -75,7 +76,7 @@
      * <code>beginXXX()</code> or <code>endXXX()</code> methods it will
      * have the <code>null</code> value.
      */
-    public ServletConfigWrapper config;
+    public AbstractServletConfigWrapper config;
 
     /**
      * @see AbstractCactusTestCase#AbstractCactusTestCase()

Modified: jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/internal/server/JspTestCaller.java
URL: http://svn.apache.org/viewcvs/jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/internal/server/JspTestCaller.java?rev=292559&r1=292558&r2=292559&view=diff
==============================================================================
--- jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/internal/server/JspTestCaller.java (original)
+++ jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/internal/server/JspTestCaller.java Thu Sep 29 14:36:43 2005
@@ -30,7 +30,7 @@
 
 import org.apache.cactus.JspTestCase;
 import org.apache.cactus.ServletURL;
-import org.apache.cactus.server.PageContextWrapper;
+import org.apache.cactus.server.AbstractPageContextWrapper;
 
 /**
  * Call the test method on the server side after assigning the JSP implicit
@@ -76,8 +76,8 @@
 
         Field pageContextField = jspInstance.getClass().getField("pageContext");
 
-        pageContextField.set(jspInstance, 
-            new PageContextWrapper(jspImplicitObjects.getPageContext(), url));
+        pageContextField.set( jspInstance,
+            AbstractPageContextWrapper.newInstance( jspImplicitObjects.getPageContext(), url) );
 
         // Set the JSP writer field of the test case class
         // -----------------------------------------------

Modified: jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/internal/server/ServletTestCaller.java
URL: http://svn.apache.org/viewcvs/jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/internal/server/ServletTestCaller.java?rev=292559&r1=292558&r2=292559&view=diff
==============================================================================
--- jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/internal/server/ServletTestCaller.java (original)
+++ jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/internal/server/ServletTestCaller.java Thu Sep 29 14:36:43 2005
@@ -31,8 +31,8 @@
 
 import org.apache.cactus.ServletTestCase;
 import org.apache.cactus.ServletURL;
-import org.apache.cactus.server.HttpServletRequestWrapper;
-import org.apache.cactus.server.ServletConfigWrapper;
+import org.apache.cactus.server.AbstractHttpServletRequestWrapper;
+import org.apache.cactus.server.AbstractServletConfigWrapper;
 
 /**
  * Responsible for instanciating the <code>TestCase</code> class on the server
@@ -76,7 +76,7 @@
         Field requestField = servletInstance.getClass().getField("request");
 
         requestField.set(servletInstance, 
-            new HttpServletRequestWrapper(request, url));
+            AbstractHttpServletRequestWrapper.newInstance(request, url));
 
         // Set the response field of the test case class
         // ---------------------------------------------
@@ -89,8 +89,8 @@
         // -------------------------------------------
         Field configField = servletInstance.getClass().getField("config");
 
-        configField.set(servletInstance, new ServletConfigWrapper(
-            servletImplicitObjects.getServletConfig()));
+        configField.set(servletInstance, AbstractServletConfigWrapper.
+			newInstance(servletImplicitObjects.getServletConfig()));
 
         // Set the session field of the test case class
         // --------------------------------------------

Modified: jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/AbstractHttpServletRequestWrapper.java
URL: http://svn.apache.org/viewcvs/jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/AbstractHttpServletRequestWrapper.java?rev=292559&r1=292558&r2=292559&view=diff
==============================================================================
--- jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/AbstractHttpServletRequestWrapper.java (original)
+++ jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/AbstractHttpServletRequestWrapper.java Thu Sep 29 14:36:43 2005
@@ -23,6 +23,8 @@
 import java.io.File;
 import java.io.IOException;
 
+import java.lang.reflect.Constructor;
+
 import java.security.Principal;
 
 import java.util.Enumeration;
@@ -35,9 +37,12 @@
 import javax.servlet.http.HttpSession;
 
 import org.apache.cactus.ServletURL;
+import org.apache.cactus.util.ChainedRuntimeException;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+
 /**
  * Abstract wrapper around {@link HttpServletRequest}. This class provides
  * a common implementation of the wrapper for the different Servlet APIs.
@@ -106,6 +111,26 @@
         this.request = theRequest;
         this.url = theURL;
     }
+
+    public static AbstractHttpServletRequestWrapper newInstance(
+        HttpServletRequest originalRequest, ServletURL theURL )
+    {
+        try
+        {
+            Class clazz = Class.forName( "org.apache.cactus.server.HttpServletRequestWrapper" );
+            Object[] args = new Object[] { originalRequest, theURL };
+
+            Constructor constructor = clazz.getConstructor(new Class[] {
+                HttpServletRequest.class, ServletURL.class } );
+
+            return (AbstractHttpServletRequestWrapper) constructor.newInstance(args);
+        }
+        catch ( Throwable t )
+        {
+            throw new ChainedRuntimeException("Failed to create HttpServletRequestWrapper", t );
+        }
+    }
+
 
     /**
      * @return the original request object

Modified: jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/AbstractPageContextWrapper.java
URL: http://svn.apache.org/viewcvs/jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/AbstractPageContextWrapper.java?rev=292559&r1=292558&r2=292559&view=diff
==============================================================================
--- jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/AbstractPageContextWrapper.java (original)
+++ jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/AbstractPageContextWrapper.java Thu Sep 29 14:36:43 2005
@@ -21,6 +21,8 @@
 
 import java.io.IOException;
 
+import java.lang.reflect.Constructor;
+
 import java.util.Enumeration;
 
 import javax.servlet.Servlet;
@@ -36,6 +38,8 @@
 import javax.servlet.jsp.tagext.BodyContent;
 
 import org.apache.cactus.ServletURL;
+import org.apache.cactus.util.ChainedRuntimeException;
+
 
 /**
  * Abstract wrapper around <code>PageContext</code>. This class provides
@@ -71,6 +75,25 @@
         this.url = theURL;
     }
 
+    public static AbstractPageContextWrapper newInstance( PageContext
+        originalPageContext, ServletURL servletURL )
+    {
+        try
+        {
+            Class clazz = Class.forName( "org.apache.cactus.server.PageContextWrapper" );
+            Object[] args = new Object[] { originalPageContext, servletURL };
+
+            Constructor constructor = clazz.getConstructor(new Class[] {
+                PageContext.class, ServletURL.class } );
+
+            return (AbstractPageContextWrapper) constructor.newInstance(args);
+        }
+        catch ( Throwable t )
+        {
+            throw new ChainedRuntimeException("Failed to create PageContextWrapper", t );
+        }
+    }
+
     // New methods ---------------------------------------------------------
 
     /**
@@ -91,7 +114,7 @@
     public ServletRequest getRequest()
     {
         // Note: we only manage HttpServletRequest here
-        return new HttpServletRequestWrapper(
+        return AbstractHttpServletRequestWrapper.newInstance(
             (HttpServletRequest) this.originalPageContext.getRequest(), 
             this.url);
     }
@@ -101,7 +124,7 @@
      */
     public ServletConfig getServletConfig()
     {
-        return new ServletConfigWrapper(
+        return AbstractServletConfigWrapper.newInstance(
             this.originalPageContext.getServletConfig());
     }
 
@@ -110,8 +133,8 @@
      */
     public ServletContext getServletContext()
     {
-        return new ServletContextWrapper(
-            this.originalPageContext.getServletContext());
+        return AbstractServletContextWrapper.newInstance(
+            originalPageContext.getServletContext() );
     }
 
     // Unmodified overridden methods -----------------------------------------

Modified: jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/AbstractServletConfigWrapper.java
URL: http://svn.apache.org/viewcvs/jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/AbstractServletConfigWrapper.java?rev=292559&r1=292558&r2=292559&view=diff
==============================================================================
--- jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/AbstractServletConfigWrapper.java (original)
+++ jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/AbstractServletConfigWrapper.java Thu Sep 29 14:36:43 2005
@@ -19,6 +19,8 @@
  */
 package org.apache.cactus.server;
 
+import java.lang.reflect.Constructor;
+
 import java.util.Enumeration;
 import java.util.Hashtable;
 import java.util.Vector;
@@ -26,6 +28,8 @@
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
 
+import org.apache.cactus.util.ChainedRuntimeException;
+
 /**
  * Abstract wrapper around <code>ServletConfig</code> which overrides the
  * <code>getServletContext()</code> method to return our own wrapper around
@@ -61,6 +65,25 @@
         this.initParameters = new Hashtable();
     }
 
+	public static AbstractServletConfigWrapper newInstance(
+		ServletConfig theOriginalConfig )
+	{
+        try
+        {
+            Class clazz = Class.forName( "org.apache.cactus.server.ServletConfigWrapper" );
+            Object[] args = new Object[] { theOriginalConfig };
+
+            Constructor constructor = clazz.getConstructor(new Class[] {
+                ServletConfig.class } );
+
+            return (AbstractServletConfigWrapper) constructor.newInstance(args);
+        }
+        catch ( Throwable t )
+        {
+            throw new ChainedRuntimeException("Failed to create ServletConfigWrapper", t );
+        }
+    }
+
     /**
      * Sets a parameter as if it were set in the <code>web.xml</code> file.
      *
@@ -99,7 +122,7 @@
      */
     public ServletContext getServletContext()
     {
-        return new ServletContextWrapper(
+        return AbstractServletContextWrapper.newInstance(
             this.originalConfig.getServletContext());
     }
 

Modified: jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/AbstractServletContextWrapper.java
URL: http://svn.apache.org/viewcvs/jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/AbstractServletContextWrapper.java?rev=292559&r1=292558&r2=292559&view=diff
==============================================================================
--- jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/AbstractServletContextWrapper.java (original)
+++ jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/AbstractServletContextWrapper.java Thu Sep 29 14:36:43 2005
@@ -21,6 +21,8 @@
 
 import java.io.InputStream;
 
+import java.lang.reflect.Constructor;
+
 import java.net.MalformedURLException;
 import java.net.URL;
 
@@ -33,6 +35,8 @@
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
 
+import org.apache.cactus.util.ChainedRuntimeException;
+
 /**
  * Abstract wrapper around <code>ServletContext</code>. This class provides
  * a common implementation of the wrapper for the different servlet API. In
@@ -73,6 +77,25 @@
         this.initParameters = new Hashtable();
     }
 
+    public static AbstractServletContextWrapper newInstance( ServletContext
+        theOriginalContext )
+    {
+        try
+        {
+            Class clazz = Class.forName( "org.apache.cactus.server.ServletContextWrapper" );
+            Object[] args = new Object[] { theOriginalContext };
+
+            Constructor constructor = clazz.getConstructor(new Class[] {
+                ServletContext.class } );
+
+            return (AbstractServletContextWrapper) constructor.newInstance(args);
+        }
+        catch ( Throwable t )
+        {
+            throw new ChainedRuntimeException("Failed to create ServletContextWrapper", t );
+        }
+    }
+
     // New methods ---------------------------------------------------------
 
     /**
@@ -387,7 +410,7 @@
      */
     public ServletContext getContext(String theUripath)
     {
-        ServletContext context = new ServletContextWrapper(
+        ServletContext context = AbstractServletContextWrapper.newInstance(
             this.originalContext.getContext(theUripath));
 
         return context;

Modified: jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/RequestDispatcherWrapper.java
URL: http://svn.apache.org/viewcvs/jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/RequestDispatcherWrapper.java?rev=292559&r1=292558&r2=292559&view=diff
==============================================================================
--- jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/RequestDispatcherWrapper.java (original)
+++ jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus/server/RequestDispatcherWrapper.java Thu Sep 29 14:36:43 2005
@@ -62,11 +62,10 @@
         throws IOException, ServletException
     {
         // Always pass the original request to the forward() call.
-        if (HttpServletRequestWrapper.class.isAssignableFrom(
-            theRequest.getClass()))
+        if ( theRequest instanceof AbstractHttpServletRequestWrapper )
         {
-            HttpServletRequestWrapper request = 
-                (HttpServletRequestWrapper) theRequest;
+            AbstractHttpServletRequestWrapper request = 
+                (AbstractHttpServletRequestWrapper) theRequest;
 
             this.originalDispatcher.forward(request.getOriginalRequest(),
                 theResponse);
@@ -91,11 +90,10 @@
         throws IOException, ServletException
     {
         // Always pass the original request to the forward() call.
-        if (HttpServletRequestWrapper.class.isAssignableFrom(
-            theRequest.getClass()))
+        if ( theRequest instanceof AbstractHttpServletRequestWrapper )
         {
-            HttpServletRequestWrapper request = 
-                (HttpServletRequestWrapper) theRequest;
+            AbstractHttpServletRequestWrapper request = 
+                (AbstractHttpServletRequestWrapper) theRequest;
 
             this.originalDispatcher.include(request.getOriginalRequest(), 
                 theResponse);



---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org


Re: branches (was: Re: svn commit: r292559... )

Posted by Kenney Westerhof <fo...@neonics.com>.
On Fri, 30 Sep 2005, Zhong ZHENG wrote:

Hi,
> Hi,
>
> I updated the wiki page for the maven 2 migration discussion:
> http://wiki.apache.org/jakarta-cactus/GeneralDiscussions/Maven2Migration

I just updated it and added some comments - sorry about the layout, I've
got zero experience in Wiki page editing.

> IMHO, maybe it will be better to keep the migration code in a separate
> branch and merge to head later when the migration is finished.

Ok. This is a bit more work later on (I'm not sure if merging moved
directories will work fine) but it's the safest for now.
I'll try to check wheter it's feasible to keep the branch up-to-date with
changes in trunk. That way we only need to 'switch' the trunk with the
branch when everybody agrees it is finished.

> Also, I am a newbie committer of the Pluto project, and am planning to add
> portlet support for Cactus. Do you think the current architecture of Cactus
> is flexible enough to add such support easily? I saw that you planned to
> refactory Cactus architecture and create version 2. So how about that effect
> now?

I'm not sure about the code architecture, but the project architecture
will be better suited in the maven2 case. I think it's best to add
support in a new subproject, since the current codebase runs fine without
that support. We can look at this like a new module or 'plugin' for
cactus. I expect you're going to have to change some existing classes
to enable support for portlets; if the projects are separated the
integration will be more dynamic and probably allows for easier
integration of future changes. Plus it'll help converting to maven2
later on.

-- Kenney

> Regards.
>
> On 9/30/05, Kenney Westerhof <fo...@neonics.com> wrote:
> >
> > On Fri, 30 Sep 2005, Zhong ZHENG wrote:
> >
> > Which branches are actually being updated? I'm used to working on trunk
> > for a next release, and when it's released create a tag + branch to
> > work on bugfixes for released versions.
> >
> > I'm going to have to change some code and move some code around in order
> > to have a better project structure, and merging will be difficult
> > afterwards. However, for now, I'm merely trying to get things working,
> > and get feedback about the new project structure. Is something final is
> > decided on, I can always start again.
> >
> > However, it might be best if the efforts to move to cargo (and other
> > current development) are all done in one branch. That would require
> > updating the ant build system to work with the new structure, but that's
> > no problem.
> >
> > Here are the options:
> >
> > - merge maven2 branch to head
> > - merge maven2 branch to another branch
> > - keep working in a separate branch, and start over/try to merge
> > later
> > - another option....
> >
> > WDYT?
> >
> > -- Kenney
> >
> >
> --
>
> ZHENG Zhong
>
> 1 Avenue Alphand
> 75116 Paris, France
> +33 6 76 80 45 90
>
> http://heavyz.sourceforge.net
> http://heavyz.blogspot.com
> http://spaces.msn.com/members/zhengzhong
>

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org


Re: branches (was: Re: svn commit: r292559... )

Posted by Zhong ZHENG <he...@gmail.com>.
Hi,

I updated the wiki page for the maven 2 migration discussion:
http://wiki.apache.org/jakarta-cactus/GeneralDiscussions/Maven2Migration

IMHO, maybe it will be better to keep the migration code in a separate
branch and merge to head later when the migration is finished.

Also, I am a newbie committer of the Pluto project, and am planning to add
portlet support for Cactus. Do you think the current architecture of Cactus
is flexible enough to add such support easily? I saw that you planned to
refactory Cactus architecture and create version 2. So how about that effect
now?

Regards.

On 9/30/05, Kenney Westerhof <fo...@neonics.com> wrote:
>
> On Fri, 30 Sep 2005, Zhong ZHENG wrote:
>
> Which branches are actually being updated? I'm used to working on trunk
> for a next release, and when it's released create a tag + branch to
> work on bugfixes for released versions.
>
> I'm going to have to change some code and move some code around in order
> to have a better project structure, and merging will be difficult
> afterwards. However, for now, I'm merely trying to get things working,
> and get feedback about the new project structure. Is something final is
> decided on, I can always start again.
>
> However, it might be best if the efforts to move to cargo (and other
> current development) are all done in one branch. That would require
> updating the ant build system to work with the new structure, but that's
> no problem.
>
> Here are the options:
>
> - merge maven2 branch to head
> - merge maven2 branch to another branch
> - keep working in a separate branch, and start over/try to merge
> later
> - another option....
>
> WDYT?
>
> -- Kenney
>
>
--

ZHENG Zhong

1 Avenue Alphand
75116 Paris, France
+33 6 76 80 45 90

http://heavyz.sourceforge.net
http://heavyz.blogspot.com
http://spaces.msn.com/members/zhengzhong

branches (was: Re: svn commit: r292559... )

Posted by Kenney Westerhof <fo...@neonics.com>.
On Fri, 30 Sep 2005, Zhong ZHENG wrote:

Which branches are actually being updated? I'm used to working on trunk
for a next release, and when it's released create a tag + branch to
work on bugfixes for released versions.

I'm going to have to change some code and move some code around in order
to have a better project structure, and merging will be difficult
afterwards. However, for now, I'm merely trying to get things working,
and get feedback about the new project structure. Is something final is
decided on, I can always start again.

However, it might be best if the efforts to move to cargo (and other
current development) are all done in one branch. That would require
updating the ant build system to work with the new structure, but that's
no problem.

Here are the options:

- merge maven2 branch to head
- merge maven2 branch to another branch
- keep working in a separate branch, and start over/try to merge
  later
- another option....

WDYT?

-- Kenney


> Hi, Kenney,
>
> Would you please tell me which branch you are migrating to create the
> MAVEN_2 branch?
> Is it the branch CACTUS_17_CARGO or the trunk?
>
> Thanks.
> <http://svn.apache.org/repos/asf/jakarta/cactus/branches/CACTUS_17_CARGO_BRANCH/>
> 2005/9/30, Vincent Massol <vm...@pivolis.com>:
> >
> > Hi Kenney and all,
> >
> > > -----Original Message-----
> > > From: kenney@apache.org [mailto:kenney@apache.org]
> > > Sent: jeudi 29 septembre 2005 23:37
> > > To: cactus-cvs@jakarta.apache.org
> > > Subject: svn commit: r292559 - in
> > > /jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-
> > >
> > framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus:
> > > ./ internal/server/ server/
> > >
> > > Author: kenney
> > > Date: Thu Sep 29 14:36:43 2005
> > > New Revision: 292559
> > >
> > > URL: http://svn.apache.org/viewcvs?rev=292559&view=rev
> > > Log:
> > > Decoupled share-12-13-14 from Wrapper implementations using reflection
> > > (a newInstance method in the AbstractXXXWrapper).
> > >
> > > Updated Wrapper-implementation references to use the Abstract base
> > class.
> >
> > Does this break the Cactus public API? If so, we need to decide what to do
> > about it as Cactus has been stable for a long time and users may not
> > understand why we break it without any added advantage for them. Also, we
> > could name it Cactus 2.x but maybe it's hard to justify as there is no new
> > feature? I'm open to all suggestions but we need to all agree as this is
> > an
> > important change it seems (unless I'm reading this wrong).
> >
> > WDYT?
> >
> > Thanks
> > -Vincent
> >
> >
> >
> >
> >
> >
> >
> > ___________________________________________________________________________
> > Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
> > T�l�chargez cette version sur http://fr.messenger.yahoo.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: cactus-dev-help@jakarta.apache.org
> >
> >
> --
>
> ZHENG Zhong
>
> 1 Avenue Alphand
> 75116 Paris, France
> +33 6 76 80 45 90
>
> http://heavyz.sourceforge.net
> http://heavyz.blogspot.com
> http://spaces.msn.com/members/zhengzhong
>

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org


Re: svn commit: r292559 - in /jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus: ./ internal/server/ server/

Posted by Kenney Westerhof <fo...@neonics.com>.
On Fri, 30 Sep 2005, Zhong ZHENG wrote:


Hi Zhong,

> Hi, Kenney,
>
> Would you please tell me which branch you are migrating to create the
> MAVEN_2 branch?
> Is it the branch CACTUS_17_CARGO or the trunk?

I branched off the trunk (i tried to keep that clear in the name of the
branch).

-- Kenney

>
> Thanks.
> <http://svn.apache.org/repos/asf/jakarta/cactus/branches/CACTUS_17_CARGO_BRANCH/>
> 2005/9/30, Vincent Massol <vm...@pivolis.com>:
> >
> > Hi Kenney and all,
> >
> > > -----Original Message-----
> > > From: kenney@apache.org [mailto:kenney@apache.org]
> > > Sent: jeudi 29 septembre 2005 23:37
> > > To: cactus-cvs@jakarta.apache.org
> > > Subject: svn commit: r292559 - in
> > > /jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-
> > >
> > framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus:
> > > ./ internal/server/ server/
> > >
> > > Author: kenney
> > > Date: Thu Sep 29 14:36:43 2005
> > > New Revision: 292559
> > >
> > > URL: http://svn.apache.org/viewcvs?rev=292559&view=rev
> > > Log:
> > > Decoupled share-12-13-14 from Wrapper implementations using reflection
> > > (a newInstance method in the AbstractXXXWrapper).
> > >
> > > Updated Wrapper-implementation references to use the Abstract base
> > class.
> >
> > Does this break the Cactus public API? If so, we need to decide what to do
> > about it as Cactus has been stable for a long time and users may not
> > understand why we break it without any added advantage for them. Also, we
> > could name it Cactus 2.x but maybe it's hard to justify as there is no new
> > feature? I'm open to all suggestions but we need to all agree as this is
> > an
> > important change it seems (unless I'm reading this wrong).
> >
> > WDYT?
> >
> > Thanks
> > -Vincent
> >
> >
> >
> >
> >
> >
> >
> > ___________________________________________________________________________
> > Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
> > T�l�chargez cette version sur http://fr.messenger.yahoo.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: cactus-dev-help@jakarta.apache.org
> >
> >
> --
>
> ZHENG Zhong
>
> 1 Avenue Alphand
> 75116 Paris, France
> +33 6 76 80 45 90
>
> http://heavyz.sourceforge.net
> http://heavyz.blogspot.com
> http://spaces.msn.com/members/zhengzhong
>

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org


Re: svn commit: r292559 - in /jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus: ./ internal/server/ server/

Posted by Zhong ZHENG <he...@gmail.com>.
Hi, Kenney,

Would you please tell me which branch you are migrating to create the
MAVEN_2 branch?
Is it the branch CACTUS_17_CARGO or the trunk?

Thanks.
<http://svn.apache.org/repos/asf/jakarta/cactus/branches/CACTUS_17_CARGO_BRANCH/>
2005/9/30, Vincent Massol <vm...@pivolis.com>:
>
> Hi Kenney and all,
>
> > -----Original Message-----
> > From: kenney@apache.org [mailto:kenney@apache.org]
> > Sent: jeudi 29 septembre 2005 23:37
> > To: cactus-cvs@jakarta.apache.org
> > Subject: svn commit: r292559 - in
> > /jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-
> >
> framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus:
> > ./ internal/server/ server/
> >
> > Author: kenney
> > Date: Thu Sep 29 14:36:43 2005
> > New Revision: 292559
> >
> > URL: http://svn.apache.org/viewcvs?rev=292559&view=rev
> > Log:
> > Decoupled share-12-13-14 from Wrapper implementations using reflection
> > (a newInstance method in the AbstractXXXWrapper).
> >
> > Updated Wrapper-implementation references to use the Abstract base
> class.
>
> Does this break the Cactus public API? If so, we need to decide what to do
> about it as Cactus has been stable for a long time and users may not
> understand why we break it without any added advantage for them. Also, we
> could name it Cactus 2.x but maybe it's hard to justify as there is no new
> feature? I'm open to all suggestions but we need to all agree as this is
> an
> important change it seems (unless I'm reading this wrong).
>
> WDYT?
>
> Thanks
> -Vincent
>
>
>
>
>
>
>
> ___________________________________________________________________________
> Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
> Téléchargez cette version sur http://fr.messenger.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-dev-help@jakarta.apache.org
>
>
--

ZHENG Zhong

1 Avenue Alphand
75116 Paris, France
+33 6 76 80 45 90

http://heavyz.sourceforge.net
http://heavyz.blogspot.com
http://spaces.msn.com/members/zhengzhong

RE: svn commit: r292559 - in /jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus: ./ internal/server/ server/

Posted by Vincent Massol <vm...@pivolis.com>.

> -----Original Message-----
> From: Kenney Westerhof [mailto:forge@neonics.com]
> Sent: vendredi 30 septembre 2005 12:52
> To: Cactus Developers List
> Subject: RE: svn commit: r292559 - in
> /jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-
> framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus:
> ./ internal/server/ server/
> 
> On Fri, 30 Sep 2005, Vincent Massol wrote:
> 
> Hi Vincent e.a.,
> 
> > Hi Kenney and all,
> > > Decoupled share-12-13-14 from Wrapper implementations using reflection
> > > (a newInstance method in the AbstractXXXWrapper).
> > >
> > > Updated Wrapper-implementation references to use the Abstract base
> class.
> >
> > Does this break the Cactus public API? If so, we need to decide what to
> do
> > about it as Cactus has been stable for a long time and users may not
> > understand why we break it without any added advantage for them. Also,
> we
> > could name it Cactus 2.x but maybe it's hard to justify as there is no
> new
> > feature? I'm open to all suggestions but we need to all agree as this is
> an
> > important change it seems (unless I'm reading this wrong).
> 
> There are two or three instances where the public api has changed,
> for instance:
> 
> cactus-framework-share-13-
> 14/src/main/java/org/apache/cactus/FilterTestCase.java
> :
> -    public org.apache.cactus.server.HttpServletRequestWrapper request;
> +    public AbstractHttpServletRequestWrapper request;
> 
> I'm not entirely sure wheter this'll break existing binaries, since the
> types are assignable, but I know that existing classes might mark
> that field as being the subtype instead of the supertype. It might work,
> it might not.
> 
> What I know for sure is that when you recompile any sources that use those
> public fields, they recompile without error.
> 
> Another change is that I added public static XXX newInstance(constructor
> params) methods to some AbstractXXWrappers. A new method shouldn't break
> existing code, but might also need recompilation.
> 
> The final change is non-breaking in that some code uses the newInstance
> method and not the 'new' call, but that's invisible to users.
> 
> I don't think a 2.x version is warranted here, because there are no new
> features, as you said.
> 
> I do think that when you guys release version 18 (or later), and these
> changes are in, that it's reasonable to expect people to recompile
> their sources against the new cactus version, in which case there
> shouldn't be any problems.
> 
> I've thought long and hard about changing those public methods, and this
> was the cleanest solution to decouple the projects (and remove circular
> dependencies). The other solution involved changing the Wrapper classes
> to be interfaces and renaming the implementation classes.
> 
> But if this is a problem I'm sure I can think of another solution
> which probably involves duplicating code.

No I don't think this is a real problem. We just need to be all aware of it,
document it properly in the next version's release notes and it should be
fine. That said, I can also say for sure that we'll get lots of people on
the mailing list asking why Cactus fails working when they migrate to the
next version. We've had this in the past and it was a bit of a pain. 

As I'm no longer following the Cactus project very closely I'll let you all
decide but I trust your judgment Kenney.

Thanks
-Vincent


---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org


RE: svn commit: r292559 - in /jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus: ./ internal/server/ server/

Posted by Kenney Westerhof <fo...@neonics.com>.
On Fri, 30 Sep 2005, Vincent Massol wrote:

Hi Vincent e.a.,

> Hi Kenney and all,
> > Decoupled share-12-13-14 from Wrapper implementations using reflection
> > (a newInstance method in the AbstractXXXWrapper).
> >
> > Updated Wrapper-implementation references to use the Abstract base class.
>
> Does this break the Cactus public API? If so, we need to decide what to do
> about it as Cactus has been stable for a long time and users may not
> understand why we break it without any added advantage for them. Also, we
> could name it Cactus 2.x but maybe it's hard to justify as there is no new
> feature? I'm open to all suggestions but we need to all agree as this is an
> important change it seems (unless I'm reading this wrong).

There are two or three instances where the public api has changed,
for instance:

cactus-framework-share-13-14/src/main/java/org/apache/cactus/FilterTestCase.java
:
-    public org.apache.cactus.server.HttpServletRequestWrapper request;
+    public AbstractHttpServletRequestWrapper request;

I'm not entirely sure wheter this'll break existing binaries, since the
types are assignable, but I know that existing classes might mark
that field as being the subtype instead of the supertype. It might work,
it might not.

What I know for sure is that when you recompile any sources that use those
public fields, they recompile without error.

Another change is that I added public static XXX newInstance(constructor
params) methods to some AbstractXXWrappers. A new method shouldn't break
existing code, but might also need recompilation.

The final change is non-breaking in that some code uses the newInstance
method and not the 'new' call, but that's invisible to users.

I don't think a 2.x version is warranted here, because there are no new
features, as you said.

I do think that when you guys release version 18 (or later), and these
changes are in, that it's reasonable to expect people to recompile
their sources against the new cactus version, in which case there
shouldn't be any problems.

I've thought long and hard about changing those public methods, and this
was the cleanest solution to decouple the projects (and remove circular
dependencies). The other solution involved changing the Wrapper classes
to be interfaces and renaming the implementation classes.

But if this is a problem I'm sure I can think of another solution
which probably involves duplicating code.

-- Kenney


---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org


RE: svn commit: r292559 - in /jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus: ./ internal/server/ server/

Posted by Vincent Massol <vm...@pivolis.com>.
Hi Kenney and all,

> -----Original Message-----
> From: kenney@apache.org [mailto:kenney@apache.org]
> Sent: jeudi 29 septembre 2005 23:37
> To: cactus-cvs@jakarta.apache.org
> Subject: svn commit: r292559 - in
> /jakarta/cactus/branches/CACTUS_TRUNK_MAVEN2_BRANCH/cactus-
> framework/cactus-framework-share-12-13-14/src/main/java/org/apache/cactus:
> ./ internal/server/ server/
> 
> Author: kenney
> Date: Thu Sep 29 14:36:43 2005
> New Revision: 292559
> 
> URL: http://svn.apache.org/viewcvs?rev=292559&view=rev
> Log:
> Decoupled share-12-13-14 from Wrapper implementations using reflection
> (a newInstance method in the AbstractXXXWrapper).
> 
> Updated Wrapper-implementation references to use the Abstract base class.

Does this break the Cactus public API? If so, we need to decide what to do
about it as Cactus has been stable for a long time and users may not
understand why we break it without any added advantage for them. Also, we
could name it Cactus 2.x but maybe it's hard to justify as there is no new
feature? I'm open to all suggestions but we need to all agree as this is an
important change it seems (unless I'm reading this wrong).

WDYT?

Thanks
-Vincent


	

	
		
___________________________________________________________________________ 
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger 
T�l�chargez cette version sur http://fr.messenger.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org