You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2022/01/11 12:23:33 UTC

[wicket] branch wicket-9.x updated (26da08f -> 934e24d)

This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a change to branch wicket-9.x
in repository https://gitbox.apache.org/repos/asf/wicket.git.


    from 26da08f  WICKET-6942 Replace usage of log4j 1.x in tests and wicket-examples with slf4j-simple
     new f6aad00  Javadoc wording improvement
     new 934e24d  WICKET-6944 Memory leak in WicketEndpoint

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/wicket/ajax/AjaxNewWindowNotifyingBehavior.java    | 4 ++--
 .../org/apache/wicket/request/component/IRequestablePage.java     | 4 ++--
 .../java/org/apache/wicket/protocol/ws/javax/WicketEndpoint.java  | 8 +++++++-
 3 files changed, 11 insertions(+), 5 deletions(-)

[wicket] 01/02: Javadoc wording improvement

Posted by mg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch wicket-9.x
in repository https://gitbox.apache.org/repos/asf/wicket.git

commit f6aad00379b977b3ad85aa8e8c445dd6a7efb47c
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Tue Jan 11 14:22:53 2022 +0200

    Javadoc wording improvement
    
    Signed-off-by: Martin Tzvetanov Grigorov <mg...@apache.org>
---
 .../java/org/apache/wicket/ajax/AjaxNewWindowNotifyingBehavior.java   | 4 ++--
 .../java/org/apache/wicket/request/component/IRequestablePage.java    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxNewWindowNotifyingBehavior.java b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxNewWindowNotifyingBehavior.java
index 06497ec..f7e982d 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxNewWindowNotifyingBehavior.java
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxNewWindowNotifyingBehavior.java
@@ -132,8 +132,8 @@ public class AjaxNewWindowNotifyingBehavior extends AbstractDefaultAjaxBehavior
 	}
 
 	/**
-	 * A callback method when a new window/tab is opened for a page instance which is already opened
-	 * in another window/tab.
+	 * A callback method that is called when a new window/tab is opened for a page instance
+	 * which is already opened in another window/tab.
 	 * <p>
 	 * Default implementation redirects to a new page instance with identical page parameters.
 	 *
diff --git a/wicket-core/src/main/java/org/apache/wicket/request/component/IRequestablePage.java b/wicket-core/src/main/java/org/apache/wicket/request/component/IRequestablePage.java
index a5cfb22..42beab8 100644
--- a/wicket-core/src/main/java/org/apache/wicket/request/component/IRequestablePage.java
+++ b/wicket-core/src/main/java/org/apache/wicket/request/component/IRequestablePage.java
@@ -45,8 +45,8 @@ public interface IRequestablePage extends IRequestableComponent, IManageablePage
 	 * Returns the number of times this page has been rendered. The number will be appended to
 	 * request listener links in order to prevent invoking listeners from staled page version.
 	 * <p>
-	 * For example a same page might have been rendered in two separate tabs. Page render doesn't
-	 * change page id but it can modify component hierarchy. Request listeners on such page
+	 * For example, the same page might have been rendered in two separate tabs. Page render doesn't
+	 * change page id, but it can modify component hierarchy. Request listeners on such page
 	 * should only work in tab where the page was rendered most recently.
 	 * 
 	 * @return render count

[wicket] 02/02: WICKET-6944 Memory leak in WicketEndpoint

Posted by mg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch wicket-9.x
in repository https://gitbox.apache.org/repos/asf/wicket.git

commit 934e24d46d654cca184aa0a379ab10fc0c5d1086
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Tue Jan 11 14:21:34 2022 +0200

    WICKET-6944 Memory leak in WicketEndpoint
    
    Register application listener only once per Application
    
    Signed-off-by: Martin Tzvetanov Grigorov <mg...@apache.org>
    (cherry picked from commit 9806e8b1b565f0b680c53df0177e8703c05b4b6a)
---
 .../java/org/apache/wicket/protocol/ws/javax/WicketEndpoint.java  | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/wicket-native-websocket/wicket-native-websocket-javax/src/main/java/org/apache/wicket/protocol/ws/javax/WicketEndpoint.java b/wicket-native-websocket/wicket-native-websocket-javax/src/main/java/org/apache/wicket/protocol/ws/javax/WicketEndpoint.java
index 4808dbd..c14cb1f 100644
--- a/wicket-native-websocket/wicket-native-websocket-javax/src/main/java/org/apache/wicket/protocol/ws/javax/WicketEndpoint.java
+++ b/wicket-native-websocket/wicket-native-websocket-javax/src/main/java/org/apache/wicket/protocol/ws/javax/WicketEndpoint.java
@@ -20,6 +20,8 @@ import java.io.EOFException;
 import java.io.IOException;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.websocket.CloseReason;
@@ -49,6 +51,7 @@ public class WicketEndpoint extends Endpoint
 	private static final String WICKET_APP_PARAM_NAME = "wicket-app-name";
 
 	private final AtomicBoolean applicationDestroyed = new AtomicBoolean(false);
+	private final Set<String> registeredListeners = ConcurrentHashMap.newKeySet();
 
 	private JavaxWebSocketProcessor javaxWebSocketProcessor;
 
@@ -58,7 +61,10 @@ public class WicketEndpoint extends Endpoint
 		String appName = getApplicationName(session);
 
 		WebApplication app = (WebApplication) WebApplication.get(appName);
-		app.getApplicationListeners().add(new ApplicationListener(applicationDestroyed));
+		if (registeredListeners.add(appName))
+		{
+			app.getApplicationListeners().add(new ApplicationListener(applicationDestroyed));
+		}
 
 		try
 		{