You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tiles.apache.org by ap...@apache.org on 2007/04/17 12:42:59 UTC

svn commit: r529551 - in /tiles/framework/trunk: tiles-core/src/main/java/org/apache/tiles/impl/ tiles-core/src/main/java/org/apache/tiles/preparer/ tiles-test/src/main/java/org/apache/tiles/test/preparer/

Author: apetrelli
Date: Tue Apr 17 03:42:50 2007
New Revision: 529551

URL: http://svn.apache.org/viewvc?view=rev&rev=529551
Log:
TILES-159
Now ViewPreparer.execute throws a PreparerException.
Added more constructors to PreparerException.

Modified:
    tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java
    tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/PreparerException.java
    tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparer.java
    tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparerSupport.java
    tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/preparer/TestViewPreparer.java

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java?view=diff&rev=529551&r1=529550&r2=529551
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java Tue Apr 17 03:42:50 2007
@@ -35,7 +35,6 @@
 import org.apache.tiles.definition.DefinitionsFactoryException;
 import org.apache.tiles.definition.NoSuchDefinitionException;
 import org.apache.tiles.preparer.NoSuchPreparerException;
-import org.apache.tiles.preparer.PreparerException;
 import org.apache.tiles.preparer.PreparerFactory;
 import org.apache.tiles.preparer.ViewPreparer;
 
@@ -355,12 +354,7 @@
 
         AttributeContext attributeContext = BasicAttributeContext.getContext(context);
 
-        // TODO: Temporary while preparerInstance gets refactored to throw a more specific exception.
-        try {
-            preparer.execute(context, attributeContext);
-        } catch (Exception e) {
-            throw new PreparerException(e.getMessage(), e);
-        }
+        preparer.execute(context, attributeContext);
     }
 
     /** {@inheritDoc} */

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/PreparerException.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/PreparerException.java?view=diff&rev=529551&r1=529550&r2=529551
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/PreparerException.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/PreparerException.java Tue Apr 17 03:42:50 2007
@@ -35,6 +35,22 @@
 
     /**
      * Constructor.
+     */
+    public PreparerException() {
+        super();
+    }
+
+    /**
+     * Constructor.
+     *
+     * @param e The cause exception.
+     */
+    public PreparerException(Exception e) {
+        super(e);
+    }
+
+    /**
+     * Constructor.
      *
      * @param message The message to include.
      */

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparer.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparer.java?view=diff&rev=529551&r1=529550&r2=529551
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparer.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparer.java Tue Apr 17 03:42:50 2007
@@ -51,9 +51,9 @@
      *
      * @param tilesContext     Current tiles application context.
      * @param attributeContext Current tile context.
-     * @throws Exception If something goes wrong during execution.
+     * @throws PreparerException If something goes wrong during execution.
      */
     void execute(TilesRequestContext tilesContext,
         AttributeContext attributeContext)
-        throws Exception;
+        throws PreparerException;
 }

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparerSupport.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparerSupport.java?view=diff&rev=529551&r1=529550&r2=529551
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparerSupport.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparerSupport.java Tue Apr 17 03:42:50 2007
@@ -35,6 +35,6 @@
 
     /** {@inheritDoc} */
     public void execute(TilesRequestContext tilesContext,
-                        AttributeContext attributeContext) throws Exception {
+                        AttributeContext attributeContext) throws PreparerException {
     }
 }

Modified: tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/preparer/TestViewPreparer.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/preparer/TestViewPreparer.java?view=diff&rev=529551&r1=529550&r2=529551
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/preparer/TestViewPreparer.java (original)
+++ tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/preparer/TestViewPreparer.java Tue Apr 17 03:42:50 2007
@@ -20,6 +20,7 @@
  */
 package org.apache.tiles.test.preparer;
 
+import org.apache.tiles.preparer.PreparerException;
 import org.apache.tiles.preparer.ViewPreparer;
 import org.apache.tiles.context.TilesRequestContext;
 import org.apache.tiles.AttributeContext;
@@ -34,7 +35,7 @@
 
     /** {@inheritDoc} */
     public void execute(TilesRequestContext tilesContext, AttributeContext attributeContext)
-    throws Exception {
+    throws PreparerException {
         attributeContext.putAttribute(
             "body",
             new Attribute("This is the value added by the ViewPreparer"));