Author: ivaynberg
Date: Thu Jan 25 10:11:53 2007
New Revision: 499877

URL: http://svn.apache.org/viewvc?view=rev&rev=499877
Log:
woops, removed in the wrong version of wicket! undo

Modified:
    incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/Page.java
    
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/RequestListenerInterface.java

Modified: 
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/Page.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/Page.java?view=diff&rev=499877&r1=499876&r2=499877
==============================================================================
--- incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/Page.java 
(original)
+++ incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/Page.java 
Thu Jan 25 10:11:53 2007
@@ -244,6 +244,42 @@
                init(pageMap);
        }
 
+
+       /**
+        * Called right after a component's listener method (the provided method
+        * argument) was called. This method may be used to clean up 
dependencies,
+        * do logging, etc. NOTE: this method will also be called when
+        * [EMAIL PROTECTED] WebPage#beforeCallComponent(Component, 
RequestListenerInterface)}
+        * or the method invocation itself failed.
+        * 
+        * @param component
+        *            the component that is to be called
+        * @param listener
+        *            the listener of that component that is to be called
+        */
+       public void afterCallComponent(final Component component,
+                       final RequestListenerInterface listener)
+       {
+       }
+
+       /**
+        * Called just before a component's listener method (the provided method
+        * argument) is called. This method may be used to set up dependencies,
+        * enforce authorization, etc. NOTE: if this method fails, the method 
will
+        * not be excuted. Method
+        * [EMAIL PROTECTED] WebPage#afterCallComponent(Component, 
RequestListenerInterface)}
+        * will always be called.
+        * 
+        * @param component
+        *            the component that is to be called
+        * @param listener
+        *            the listener of that component that is to be called
+        */
+       public void beforeCallComponent(final Component component,
+                       final RequestListenerInterface listener)
+       {
+       }
+
        /**
         * @see wicket.MarkupContainer#internalDetach()
         */

Modified: 
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/RequestListenerInterface.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/RequestListenerInterface.java?view=diff&rev=499877&r1=499876&r2=499877
==============================================================================
--- 
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/RequestListenerInterface.java
 (original)
+++ 
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/RequestListenerInterface.java
 Thu Jan 25 10:11:53 2007
@@ -154,6 +154,8 @@
         */
        public final void invoke(final Page page, final Component component)
        {
+               page.beforeCallComponent(component, this);
+
                try
                {
                        // Invoke the interface method on the component
@@ -177,6 +179,10 @@
                        throw new WicketRuntimeException("Method " + 
method.getName() + " of "
                                        + method.getDeclaringClass() + " 
targeted at component " + component
                                        + " threw an exception", e);
+               }
+               finally
+               {
+                       page.afterCallComponent(component, this);
                }
        }
 


Reply via email to