Author: ehillenius
Date: Mon May  7 05:53:42 2007
New Revision: 535872

URL: http://svn.apache.org/viewvc?view=rev&rev=535872
Log:
it's better in the set method

Modified:
    
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java

Modified: 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java?view=diff&rev=535872&r1=535871&r2=535872
==============================================================================
--- 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java
 (original)
+++ 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java
 Mon May  7 05:53:42 2007
@@ -261,12 +261,9 @@
                                        requestCycle.getResponse());
                }
 
+               // set thread local
                set(session);
 
-               // Set the current session
-               // execute any attach logic now
-               session.attach();
-
                return session;
        }
 
@@ -288,7 +285,8 @@
        /**
         * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL IT.
         * <p>
-        * Sets session for calling thread.
+        * Sets session for calling thread. Also triggers [EMAIL PROTECTED] 
#attach()} being
+        * called.
         * 
         * @param session
         *            The session
@@ -299,7 +297,11 @@
                {
                        throw new IllegalArgumentException("Argument session 
can not be null");
                }
+
                current.set(session);
+
+               // execute any attach logic now
+               session.attach();
        }
 
        /**
@@ -1074,9 +1076,7 @@
 
        /**
         * Any attach logic for session subclasses. Called when a session is 
set for
-        * the thread. Note that this is done on demand (lazily): as long as the
-        * session isn't being used, it is not located or created and this 
method is
-        * not called.
+        * the thread.
         */
        protected void attach()
        {


Reply via email to