Updated Branches: refs/heads/master e5bcce1cc -> e918a05df
Do not store the session id as a member field in the Session binding listener. The session (and its id) is available when #valueUnbound() is called. Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/e918a05d Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/e918a05d Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/e918a05d Branch: refs/heads/master Commit: e918a05df3de2afede5a32fa82ca96eac2bbb6e3 Parents: e5bcce1 Author: Martin Tzvetanov Grigorov <[email protected]> Authored: Mon Mar 12 13:03:56 2012 +0200 Committer: Martin Tzvetanov Grigorov <[email protected]> Committed: Mon Mar 12 13:03:56 2012 +0200 ---------------------------------------------------------------------- .../apache/wicket/session/HttpSessionStore.java | 19 ++++---------- 1 files changed, 6 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/e918a05d/wicket-core/src/main/java/org/apache/wicket/session/HttpSessionStore.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/session/HttpSessionStore.java b/wicket-core/src/main/java/org/apache/wicket/session/HttpSessionStore.java index a4d22c8..24c3607 100644 --- a/wicket-core/src/main/java/org/apache/wicket/session/HttpSessionStore.java +++ b/wicket-core/src/main/java/org/apache/wicket/session/HttpSessionStore.java @@ -117,7 +117,7 @@ public class HttpSessionStore implements ISessionStore // register an unbinding listener for cleaning up String applicationKey = Application.get().getName(); httpSession.setAttribute("Wicket:SessionUnbindingListener-" + applicationKey, - new SessionBindingListener(applicationKey, httpSession.getId())); + new SessionBindingListener(applicationKey)); // register the session object itself setAttribute(request, Session.SESSION_ATTRIBUTE_NAME, newSession); @@ -413,21 +413,15 @@ public class HttpSessionStore implements ISessionStore /** The unique key of the application within this web application. */ private final String applicationKey; - /** Session id. */ - private final String sessionId; - /** * Construct. * * @param applicationKey * The unique key of the application within this web application - * @param sessionId - * The session's id */ - public SessionBindingListener(final String applicationKey, final String sessionId) + public SessionBindingListener(final String applicationKey) { this.applicationKey = applicationKey; - this.sessionId = sessionId; } /** @@ -444,15 +438,14 @@ public class HttpSessionStore implements ISessionStore @Override public void valueUnbound(final HttpSessionBindingEvent evt) { - if (log.isDebugEnabled()) - { - log.debug("Session unbound: " + sessionId); - } + String sessionId = evt.getSession().getId(); + + log.debug("Session unbound: {}", sessionId); Application application = Application.get(applicationKey); if (application == null) { - log.debug("Wicket application with name '" + applicationKey + "' not found."); + log.debug("Wicket application with name '{}' not found.", applicationKey); return; }
