You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by lh...@apache.org on 2013/03/14 01:16:29 UTC

svn commit: r1456290 - in /shiro/branches/SHIRO-317b/core/src/main/java/org/apache/shiro: session/mgt/StandardSessionManager.java util/Assert.java

Author: lhazlewood
Date: Thu Mar 14 00:16:29 2013
New Revision: 1456290

URL: http://svn.apache.org/r1456290
Log:
Minor trigger of an event when a Session is started.

Modified:
    shiro/branches/SHIRO-317b/core/src/main/java/org/apache/shiro/session/mgt/StandardSessionManager.java
    shiro/branches/SHIRO-317b/core/src/main/java/org/apache/shiro/util/Assert.java

Modified: shiro/branches/SHIRO-317b/core/src/main/java/org/apache/shiro/session/mgt/StandardSessionManager.java
URL: http://svn.apache.org/viewvc/shiro/branches/SHIRO-317b/core/src/main/java/org/apache/shiro/session/mgt/StandardSessionManager.java?rev=1456290&r1=1456289&r2=1456290&view=diff
==============================================================================
--- shiro/branches/SHIRO-317b/core/src/main/java/org/apache/shiro/session/mgt/StandardSessionManager.java (original)
+++ shiro/branches/SHIRO-317b/core/src/main/java/org/apache/shiro/session/mgt/StandardSessionManager.java Thu Mar 14 00:16:29 2013
@@ -183,7 +183,12 @@ public class StandardSessionManager impl
         enableSessionValidationIfNecessary();
         Session internal = createInternalSession(context);
         //Don't expose the EIS-tier Session object to the client-tier:
-        return createExposedSession(internal, context);
+        Session exposed = createExposedSession(internal, context);
+
+        StartedSessionEvent event = new StartedSessionEvent(exposed, context);
+        notify(event);
+
+        return exposed;
     }
 
     protected Session createInternalSession(SessionContext context) {
@@ -201,9 +206,6 @@ public class StandardSessionManager impl
 
         createInternalSession(session, context);
 
-        StartedSessionEvent event = new StartedSessionEvent(session, context);
-        notify(event);
-
         return session;
     }
 

Modified: shiro/branches/SHIRO-317b/core/src/main/java/org/apache/shiro/util/Assert.java
URL: http://svn.apache.org/viewvc/shiro/branches/SHIRO-317b/core/src/main/java/org/apache/shiro/util/Assert.java?rev=1456290&r1=1456289&r2=1456290&view=diff
==============================================================================
--- shiro/branches/SHIRO-317b/core/src/main/java/org/apache/shiro/util/Assert.java (original)
+++ shiro/branches/SHIRO-317b/core/src/main/java/org/apache/shiro/util/Assert.java Thu Mar 14 00:16:29 2013
@@ -6,6 +6,8 @@ import java.util.Map;
 /**
  * Assertion utility class that assists in validating arguments.
  * Useful for identifying programmer errors early and clearly at runtime.
+ * Regular usage also reduces a program's
+ * <a href="http://en.wikipedia.org/wiki/Cyclomatic_complexity">cyclomatic complexity</a>.
  *
  * <p>For example, if the contract of a public method states it does not
  * allow <code>null</code> arguments, Assert can be used to validate that