WICKET-5068 PageParameters missing from re-created Page
WICKET-5070 Optionally execute Callback Behavior on Re-construction after Expiry
WICKET-5001 Recovery of bookmarkable Page after Session Expiry

Rename the new setting to be Java bean complaint

suggested-by: Sven Meier


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/4299d74c
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/4299d74c
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/4299d74c

Branch: refs/heads/master
Commit: 4299d74c9c1d7fcc90485af7a8f8e4a4d5c19f5b
Parents: 565346c
Author: Martin Tzvetanov Grigorov <mgrigo...@apache.org>
Authored: Thu Jan 16 12:41:24 2014 +0200
Committer: Martin Tzvetanov Grigorov <mgrigo...@apache.org>
Committed: Thu Jan 16 12:41:24 2014 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/wicket/Component.java  |  2 +-
 .../apache/wicket/settings/PageSettings.java    | 25 ++++++++++++++++----
 .../PageExpirationRecoveryTest.java             |  4 ++--
 3 files changed, 23 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/4299d74c/wicket-core/src/main/java/org/apache/wicket/Component.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/Component.java 
b/wicket-core/src/main/java/org/apache/wicket/Component.java
index 62d67ac..25cb11f 100644
--- a/wicket-core/src/main/java/org/apache/wicket/Component.java
+++ b/wicket-core/src/main/java/org/apache/wicket/Component.java
@@ -4554,6 +4554,6 @@ public abstract class Component
        @Override
        public boolean canCallListenerInterfaceAfterExpiry()
        {
-               return 
getApplication().getPageSettings().canCallListenerInterfaceAfterExpiry();
+               return 
getApplication().getPageSettings().getCallListenerInterfaceAfterExpiry();
        }
 }

http://git-wip-us.apache.org/repos/asf/wicket/blob/4299d74c/wicket-core/src/main/java/org/apache/wicket/settings/PageSettings.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/settings/PageSettings.java 
b/wicket-core/src/main/java/org/apache/wicket/settings/PageSettings.java
index 9fafe1d..8070359 100644
--- a/wicket-core/src/main/java/org/apache/wicket/settings/PageSettings.java
+++ b/wicket-core/src/main/java/org/apache/wicket/settings/PageSettings.java
@@ -48,7 +48,7 @@ public class PageSettings
         * determines whether component's listener interface can be executed
         * when its owner page is freshly created after expiration
         */
-       private boolean canCallListenerInterfaceAfterExpiry = false;
+       private boolean callListenerInterfaceAfterExpiry = false;
 
        /**
         * Adds a component resolver to the list.
@@ -122,13 +122,28 @@ public class PageSettings
                this.recreateMountedPagesAfterExpiry = 
recreateMountedPagesAfterExpiry;
        }
 
-       public boolean canCallListenerInterfaceAfterExpiry()
+       /**
+        * @return {@code true} if Wicket should execute the listener interface 
of a component
+        *      which owner page is freshly created after expiration of the old 
one
+        * @see #getRecreateMountedPagesAfterExpiry()
+        * @see 
org.apache.wicket.request.component.IRequestableComponent#canCallListenerInterfaceAfterExpiry()
+        */
+       public boolean getCallListenerInterfaceAfterExpiry()
        {
-               return recreateMountedPagesAfterExpiry && 
canCallListenerInterfaceAfterExpiry;
+               return recreateMountedPagesAfterExpiry && 
callListenerInterfaceAfterExpiry;
        }
 
-       public void setCanCallListenerInterfaceAfterExpiry(boolean 
canCallListenerInterfaceAfterExpiry)
+       /**
+        * Sets a setting that determines whether Wicket should execute the 
listener interface of a component
+        * which owner page is freshly created after expiration of the old one
+        *
+        * @param callListenerInterfaceAfterExpiry
+        *          {@code true} if Wicket should execute the listener interface
+        * @see #setRecreateMountedPagesAfterExpiry(boolean) 
+        * @see 
org.apache.wicket.request.component.IRequestableComponent#canCallListenerInterfaceAfterExpiry()
+        */
+       public void setCallListenerInterfaceAfterExpiry(boolean 
callListenerInterfaceAfterExpiry)
        {
-               this.canCallListenerInterfaceAfterExpiry = 
canCallListenerInterfaceAfterExpiry;
+               this.callListenerInterfaceAfterExpiry = 
callListenerInterfaceAfterExpiry;
        }
 }

http://git-wip-us.apache.org/repos/asf/wicket/blob/4299d74c/wicket-core/src/test/java/org/apache/wicket/page/expirationrecovery/PageExpirationRecoveryTest.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/test/java/org/apache/wicket/page/expirationrecovery/PageExpirationRecoveryTest.java
 
b/wicket-core/src/test/java/org/apache/wicket/page/expirationrecovery/PageExpirationRecoveryTest.java
index ef929fae..67c4b46 100644
--- 
a/wicket-core/src/test/java/org/apache/wicket/page/expirationrecovery/PageExpirationRecoveryTest.java
+++ 
b/wicket-core/src/test/java/org/apache/wicket/page/expirationrecovery/PageExpirationRecoveryTest.java
@@ -67,7 +67,7 @@ public class PageExpirationRecoveryTest extends WicketTestCase
        {
                PageSettings pageSettings = 
tester.getApplication().getPageSettings();
                pageSettings.setRecreateMountedPagesAfterExpiry(true); // CAN 
recreate
-               pageSettings.setCanCallListenerInterfaceAfterExpiry(false); // 
CANNOT execute listener interfaces
+               pageSettings.setCallListenerInterfaceAfterExpiry(false); // 
CANNOT execute listener interfaces
 
                ExpirationRecoveryPage page = 
tester.startPage(ExpirationRecoveryPage.class, parameters);
                assertEquals(parameters, page.getPageParameters());
@@ -123,7 +123,7 @@ public class PageExpirationRecoveryTest extends 
WicketTestCase
        public void canExecuteListenerInterface()
        {
                PageSettings pageSettings = 
tester.getApplication().getPageSettings();
-               pageSettings.setCanCallListenerInterfaceAfterExpiry(true);
+               pageSettings.setCallListenerInterfaceAfterExpiry(true);
                pageSettings.setRecreateMountedPagesAfterExpiry(true);
 
                ExpirationRecoveryPage page = 
tester.startPage(ExpirationRecoveryPage.class, parameters);

Reply via email to