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 2010/05/18 08:36:56 UTC
svn commit: r945518 [1/2] - in
/incubator/shiro/branches/session_manager_API_change: ./ all/ core/src/
core/src/main/java/org/apache/shiro/mgt/
core/src/main/java/org/apache/shiro/session/mgt/
core/src/main/java/org/apache/shiro/subject/support/ core/s...
Author: lhazlewood
Date: Tue May 18 06:36:55 2010
New Revision: 945518
URL: http://svn.apache.org/viewvc?rev=945518&view=rev
Log:
SHIRO-164 - implemented SessionManager API change to a branch for peer review and testing.
Added:
incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/AbstractNativeSessionManager.java
incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/NativeSessionManager.java
incubator/shiro/branches/session_manager_API_change/samples/spring-client/samples-spring-client.iml
incubator/shiro/branches/session_manager_API_change/web/src/main/java/org/apache/shiro/web/util/
incubator/shiro/branches/session_manager_API_change/web/src/main/java/org/apache/shiro/web/util/RequestPairSource.java
Removed:
incubator/shiro/branches/session_manager_API_change/web/src/main/java/org/apache/shiro/web/DelegatingWebSecurityManager.java
incubator/shiro/branches/session_manager_API_change/web/src/main/java/org/apache/shiro/web/session/DelegatingWebSessionManager.java
incubator/shiro/branches/session_manager_API_change/web/src/main/java/org/apache/shiro/web/session/WebSessionManager.java
incubator/shiro/branches/session_manager_API_change/web/src/main/java/org/apache/shiro/web/subject/support/WebSubjectCallable.java
incubator/shiro/branches/session_manager_API_change/web/src/main/java/org/apache/shiro/web/subject/support/WebSubjectRunnable.java
incubator/shiro/branches/session_manager_API_change/web/src/main/java/org/apache/shiro/web/subject/support/WebSubjectThreadState.java
incubator/shiro/branches/session_manager_API_change/web/src/test/java/org/apache/shiro/web/DelegatingWebSecurityManagerTest.java
Modified:
incubator/shiro/branches/session_manager_API_change/ (props changed)
incubator/shiro/branches/session_manager_API_change/all/pom.xml
incubator/shiro/branches/session_manager_API_change/core/src/ (props changed)
incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/mgt/DefaultSecurityManager.java
incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/mgt/SessionsSecurityManager.java
incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/AbstractSessionManager.java
incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/AbstractValidatingSessionManager.java
incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/DefaultSessionContext.java
incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/DefaultSessionManager.java
incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/DelegatingSession.java
incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/SessionContext.java
incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/SessionManager.java
incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/subject/support/DefaultSubjectContext.java
incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java
incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/util/MapContext.java
incubator/shiro/branches/session_manager_API_change/pom.xml
incubator/shiro/branches/session_manager_API_change/samples/pom.xml
incubator/shiro/branches/session_manager_API_change/samples/spring-hibernate/ (props changed)
incubator/shiro/branches/session_manager_API_change/support/spring/src/main/java/org/apache/shiro/spring/remoting/SecureRemoteInvocationFactory.java
incubator/shiro/branches/session_manager_API_change/support/spring/src/test/java/org/apache/shiro/spring/remoting/SecureRemoteInvocationFactoryTest.java
incubator/shiro/branches/session_manager_API_change/web/src/main/java/org/apache/shiro/web/DefaultWebSecurityManager.java
incubator/shiro/branches/session_manager_API_change/web/src/main/java/org/apache/shiro/web/WebUtils.java
incubator/shiro/branches/session_manager_API_change/web/src/main/java/org/apache/shiro/web/session/DefaultWebSessionManager.java
incubator/shiro/branches/session_manager_API_change/web/src/main/java/org/apache/shiro/web/session/ServletContainerSessionManager.java
incubator/shiro/branches/session_manager_API_change/web/src/main/java/org/apache/shiro/web/session/WebSessionContext.java
incubator/shiro/branches/session_manager_API_change/web/src/main/java/org/apache/shiro/web/subject/WebSubject.java
incubator/shiro/branches/session_manager_API_change/web/src/main/java/org/apache/shiro/web/subject/WebSubjectContext.java
incubator/shiro/branches/session_manager_API_change/web/src/main/java/org/apache/shiro/web/subject/support/DefaultWebSubjectContext.java
incubator/shiro/branches/session_manager_API_change/web/src/main/java/org/apache/shiro/web/subject/support/WebDelegatingSubject.java
incubator/shiro/branches/session_manager_API_change/web/src/test/java/org/apache/shiro/web/AbstractWebSecurityManagerTest.java
incubator/shiro/branches/session_manager_API_change/web/src/test/java/org/apache/shiro/web/DefaultWebSecurityManagerTest.java
incubator/shiro/branches/session_manager_API_change/web/src/test/java/org/apache/shiro/web/session/DefaultWebSessionManagerTest.java
Propchange: incubator/shiro/branches/session_manager_API_change/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue May 18 06:36:55 2010
@@ -4,3 +4,5 @@ target
.settings
.project
.classpath
+
+*.idea
Propchange: incubator/shiro/branches/session_manager_API_change/
------------------------------------------------------------------------------
svn:mergeinfo = /incubator/shiro/trunk:945461-945509
Modified: incubator/shiro/branches/session_manager_API_change/all/pom.xml
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/session_manager_API_change/all/pom.xml?rev=945518&r1=945517&r2=945518&view=diff
==============================================================================
--- incubator/shiro/branches/session_manager_API_change/all/pom.xml (original)
+++ incubator/shiro/branches/session_manager_API_change/all/pom.xml Tue May 18 06:36:55 2010
@@ -108,5 +108,14 @@
</plugins>
</build>
-
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
</project>
\ No newline at end of file
Propchange: incubator/shiro/branches/session_manager_API_change/core/src/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 18 06:36:55 2010
@@ -1 +1,2 @@
/incubator/jsecurity/import/trunk/src:711429-749338
+/incubator/shiro/trunk/core/src:945461-945509
Modified: incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/mgt/DefaultSecurityManager.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/mgt/DefaultSecurityManager.java?rev=945518&r1=945517&r2=945518&view=diff
==============================================================================
--- incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/mgt/DefaultSecurityManager.java (original)
+++ incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/mgt/DefaultSecurityManager.java Tue May 18 06:36:55 2010
@@ -23,9 +23,7 @@ import org.apache.shiro.authz.Authorizer
import org.apache.shiro.realm.Realm;
import org.apache.shiro.session.InvalidSessionException;
import org.apache.shiro.session.Session;
-import org.apache.shiro.session.SessionException;
import org.apache.shiro.session.mgt.DefaultSessionContext;
-import org.apache.shiro.session.mgt.DelegatingSession;
import org.apache.shiro.session.mgt.SessionContext;
import org.apache.shiro.subject.PrincipalCollection;
import org.apache.shiro.subject.Subject;
@@ -35,7 +33,6 @@ import org.apache.shiro.util.CollectionU
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.io.Serializable;
import java.util.Collection;
/**
@@ -124,11 +121,6 @@ public class DefaultSecurityManager exte
this.rememberMeManager = rememberMeManager;
}
- protected Session getSession(Serializable id) {
- checkValid(id);
- return new DelegatingSession(this, id);
- }
-
protected SubjectContext createSubjectContext() {
return new DefaultSubjectContext();
}
@@ -287,7 +279,7 @@ public class DefaultSecurityManager exte
}
Subject loggedIn = createSubject(token, info, subject);
- //TODO - is binding necessary anymore? Shouldn't the Builders or Builder callers do this now?
+
bind(loggedIn);
onSuccessfulLogin(token, info, loggedIn);
@@ -387,7 +379,6 @@ public class DefaultSecurityManager exte
context.setSession(session);
}
} catch (InvalidSessionException e) {
- onInvalidSession(context, e);
log.debug("Resolved SubjectContext context session is invalid. Ignoring and creating an anonymous " +
"(session-less) Subject instance.", e);
}
@@ -395,19 +386,8 @@ public class DefaultSecurityManager exte
}
protected Session resolveContextSession(SubjectContext context) throws InvalidSessionException {
- return resolveContextSessionById(context);
- }
-
- protected Session resolveContextSessionById(SubjectContext context) throws InvalidSessionException {
- log.trace("No session found in context. Looking for a session id to resolve in to a session.");
- //otherwise try to resolve a session if a session id exists:
- Serializable sessionId = getSessionId(context);
- if (sessionId != null) {
- log.debug("Discovered context session id [{}]. Attempting to acquire the associated Session instance.");
- return getSession(sessionId);
- }
- log.trace("No session id found in the context. A context session cannot be resolved.");
- return null;
+ SessionContext sessionContext = createSessionContext(context);
+ return getSession(sessionContext);
}
/**
@@ -497,31 +477,6 @@ public class DefaultSecurityManager exte
return sessionContext;
}
- /**
- * Allows subclasses to react to the fact that attempting to resolve a session based on the given SubjectContext
- * failed. Default implementation does nothing (no-op).
- *
- * @param subjectContext the subjectContext from where the sessionId was discovered
- * @param e the exception thrown while attempting to resolve the context's session
- * @since 1.0
- */
- protected void onInvalidSession(SubjectContext subjectContext, SessionException e) {
- }
-
- /**
- * Utility method to retrieve the session id from the given subject context which will be used to resolve
- * to a {@link Session}, or {@code null} if there is no session id available.
- *
- * @param subjectContext the context map with data that will be used to construct a {@link Subject} instance via
- * a {@link SubjectFactory}
- * @return a session id to resolve to a {@link Session} instance or {@code null} if a session id could not be found.
- * @see SecurityManager#createSubject(SubjectContext)
- * @see SubjectFactory#createSubject(SubjectContext)
- */
- protected Serializable getSessionId(SubjectContext subjectContext) {
- return subjectContext.getSessionId();
- }
-
public void logout(Subject subject) {
if (subject == null) {
@@ -564,24 +519,7 @@ public class DefaultSecurityManager exte
protected void stopSession(Subject subject) {
Session s = subject.getSession(false);
if (s != null) {
- //react to the id and not the session itself - the Session instance could be a proxy/delegate Session
- //in which case the ID might be the only thing accessible. Better to pass off the ID to the underlying
- //SessionManager since this will successfully handle all cases.
- Serializable sessionId = s.getId();
- if (sessionId != null) {
- try {
- stop(sessionId);
- } catch (SessionException e) {
- //ignored - we're invalidating, and have no further need of the session anyway
- //log just in case someone wants to know:
- if (log.isDebugEnabled()) {
- String msg = "Session for Subject [" + (subject != null ? subject.getPrincipal() : null) +
- "] has already been invalidated. Logging exception since session exceptions are " +
- "irrelevant when the owning Subject has logged out.";
- log.debug(msg, e);
- }
- }
- }
+ s.stop();
}
}
Modified: incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/mgt/SessionsSecurityManager.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/mgt/SessionsSecurityManager.java?rev=945518&r1=945517&r2=945518&view=diff
==============================================================================
--- incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/mgt/SessionsSecurityManager.java (original)
+++ incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/mgt/SessionsSecurityManager.java Tue May 18 06:36:55 2010
@@ -20,24 +20,20 @@ package org.apache.shiro.mgt;
import org.apache.shiro.authz.AuthorizationException;
import org.apache.shiro.cache.CacheManagerAware;
-import org.apache.shiro.session.InvalidSessionException;
import org.apache.shiro.session.Session;
+import org.apache.shiro.session.SessionException;
import org.apache.shiro.session.mgt.DefaultSessionManager;
import org.apache.shiro.session.mgt.SessionContext;
import org.apache.shiro.session.mgt.SessionManager;
import org.apache.shiro.util.LifecycleUtils;
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.Date;
-
/**
* Shiro support of a {@link SecurityManager} class hierarchy that delegates all
- * {@link org.apache.shiro.session.Session session} operations to a wrapped {@link org.apache.shiro.session.mgt.SessionManager SessionManager}
- * instance. That is, this class implements the methods in the
- * {@link SessionManager SessionManager} interface, but in reality, those methods are merely passthrough calls to
- * the underlying 'real' {@code SessionManager} instance.
+ * {@link org.apache.shiro.session.Session session} operations to a wrapped
+ * {@link org.apache.shiro.session.mgt.SessionManager SessionManager} instance. That is, this class implements the
+ * methods in the {@link SessionManager SessionManager} interface, but in reality, those methods are merely
+ * passthrough calls to the underlying 'real' {@code SessionManager} instance.
* <p/>
* The remaining {@code SecurityManager} methods not implemented by this class or its parents are left to be
* implemented by subclasses.
@@ -121,60 +117,12 @@ public abstract class SessionsSecurityMa
}
}
- public Session start(SessionContext initData) throws AuthorizationException {
- return this.sessionManager.start(initData);
- }
-
- public Date getStartTimestamp(Serializable sessionId) {
- return this.sessionManager.getStartTimestamp(sessionId);
- }
-
- public Date getLastAccessTime(Serializable sessionId) {
- return this.sessionManager.getLastAccessTime(sessionId);
- }
-
- public boolean isValid(Serializable sessionId) {
- return this.sessionManager.isValid(sessionId);
- }
-
- public void checkValid(Serializable sessionId) throws InvalidSessionException {
- this.sessionManager.checkValid(sessionId);
- }
-
- public long getTimeout(Serializable sessionId) throws InvalidSessionException {
- return this.sessionManager.getTimeout(sessionId);
- }
-
- public void setTimeout(Serializable sessionId, long maxIdleTimeInMillis) throws InvalidSessionException {
- this.sessionManager.setTimeout(sessionId, maxIdleTimeInMillis);
- }
-
- public void touch(Serializable sessionId) throws InvalidSessionException {
- this.sessionManager.touch(sessionId);
- }
-
- public String getHost(Serializable sessionId) {
- return this.sessionManager.getHost(sessionId);
- }
-
- public void stop(Serializable sessionId) throws InvalidSessionException {
- this.sessionManager.stop(sessionId);
- }
-
- public Collection<Object> getAttributeKeys(Serializable sessionId) {
- return this.sessionManager.getAttributeKeys(sessionId);
- }
-
- public Object getAttribute(Serializable sessionId, Object key) throws InvalidSessionException {
- return this.sessionManager.getAttribute(sessionId, key);
- }
-
- public void setAttribute(Serializable sessionId, Object key, Object value) throws InvalidSessionException {
- this.sessionManager.setAttribute(sessionId, key, value);
+ public Session start(SessionContext context) throws AuthorizationException {
+ return this.sessionManager.start(context);
}
- public Object removeAttribute(Serializable sessionId, Object key) throws InvalidSessionException {
- return this.sessionManager.removeAttribute(sessionId, key);
+ public Session getSession(SessionContext context) throws SessionException {
+ return this.sessionManager.getSession(context);
}
public void destroy() {
Added: incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/AbstractNativeSessionManager.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/AbstractNativeSessionManager.java?rev=945518&view=auto
==============================================================================
--- incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/AbstractNativeSessionManager.java (added)
+++ incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/AbstractNativeSessionManager.java Tue May 18 06:36:55 2010
@@ -0,0 +1,274 @@
+/*
+ * Copyright 2008 Les Hazlewood
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.shiro.session.mgt;
+
+import org.apache.shiro.authz.AuthorizationException;
+import org.apache.shiro.session.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+
+/**
+ * @author Les Hazlewood
+ * @since 1.0
+ */
+public abstract class AbstractNativeSessionManager extends AbstractSessionManager implements NativeSessionManager {
+
+ private static final Logger log = LoggerFactory.getLogger(AbstractSessionManager.class);
+
+ private Collection<SessionListener> listeners;
+
+ public AbstractNativeSessionManager() {
+ this.listeners = new ArrayList<SessionListener>();
+ }
+
+ public void setSessionListeners(Collection<SessionListener> listeners) {
+ this.listeners = listeners != null ? listeners : new ArrayList<SessionListener>();
+ }
+
+ @SuppressWarnings({"UnusedDeclaration"})
+ public Collection<SessionListener> getSessionListeners() {
+ return this.listeners;
+ }
+
+ public Session start(SessionContext context) {
+ Session session = createSession(context);
+ applyGlobalSessionTimeout(session);
+ onStart(session, context);
+ notifyStart(session);
+ //Don't expose the EIS-tier Session object to the client-tier:
+ return createExposedSession(session, context);
+ }
+
+ protected void applyGlobalSessionTimeout(Session session) {
+ session.setTimeout(getGlobalSessionTimeout());
+ onChange(session);
+ }
+
+ public Session getSession(SessionContext context) throws SessionException {
+ if (context == null) {
+ throw new NullPointerException("SessionContext argument cannot be null.");
+ }
+ Serializable sessionId = getSessionId(context);
+ if (sessionId == null) {
+ String msg = "Unable to resolve a session id from SessionContext [" + context + "]. This is " +
+ "required to retrieve the corresponding session.";
+ throw new UnknownSessionException(msg);
+ }
+ Session s;
+ try {
+ s = doGetSession(sessionId);
+ } catch (InvalidSessionException e) {
+ onInvalidSession(context, sessionId, e);
+ //propagate:
+ throw e;
+ }
+ return createExposedSession(s, context);
+ }
+
+ protected void onInvalidSession(SessionContext context, Serializable sessionId, InvalidSessionException ise) {
+ }
+
+ public Serializable getSessionId(SessionContext context) {
+ return context.getSessionId();
+ }
+
+ protected Session createExposedSession(Session session, SessionContext context) {
+ return new DelegatingSession(this, session.getId());
+ }
+
+ /**
+ * Returns the session instance to use to pass to registered {@code SessionListener}s for notification
+ * that the session has been invalidated (stopped or expired).
+ * <p/>
+ * The default implementation returns an {@link ImmutableProxiedSession ImmutableProxiedSession} instance to ensure
+ * that the specified {@code session} argument is not modified by any listeners.
+ *
+ * @param session the {@code Session} object being invalidated.
+ * @return the {@code Session} instance to use to pass to registered {@code SessionListener}s for notification.
+ */
+ protected Session beforeInvalidNotification(Session session) {
+ return new ImmutableProxiedSession(session);
+ }
+
+ /**
+ * Notifies any interested {@link SessionListener}s that a Session has started. This method is invoked
+ * <em>after</em> the {@link #onStart onStart} method is called.
+ *
+ * @param session the session that has just started that will be delivered to any
+ * {@link #setSessionListeners(java.util.Collection) registered} session listeners.
+ * @see SessionListener#onStart(org.apache.shiro.session.Session)
+ */
+ protected void notifyStart(Session session) {
+ for (SessionListener listener : this.listeners) {
+ listener.onStart(session);
+ }
+ }
+
+ protected void notifyStop(Session session) {
+ Session forNotification = beforeInvalidNotification(session);
+ for (SessionListener listener : this.listeners) {
+ listener.onStop(forNotification);
+ }
+ }
+
+ protected void notifyExpiration(Session session) {
+ Session forNotification = beforeInvalidNotification(session);
+ for (SessionListener listener : this.listeners) {
+ listener.onExpiration(forNotification);
+ }
+ }
+
+ public Date getStartTimestamp(Serializable sessionId) {
+ return getSession(sessionId).getStartTimestamp();
+ }
+
+ public Date getLastAccessTime(Serializable sessionId) {
+ return getSession(sessionId).getLastAccessTime();
+ }
+
+ public long getTimeout(Serializable sessionId) throws InvalidSessionException {
+ return getSession(sessionId).getTimeout();
+ }
+
+ public void setTimeout(Serializable sessionId, long maxIdleTimeInMillis) throws InvalidSessionException {
+ Session s = getSession(sessionId);
+ s.setTimeout(maxIdleTimeInMillis);
+ onChange(s);
+ }
+
+ public void touch(Serializable sessionId) throws InvalidSessionException {
+ Session s = getSession(sessionId);
+ s.touch();
+ onChange(s);
+ }
+
+ public String getHost(Serializable sessionId) {
+ return getSession(sessionId).getHost();
+ }
+
+ public void stop(Serializable sessionId) throws InvalidSessionException {
+ Session session = getSession(sessionId);
+ stop(session);
+ }
+
+ protected void stop(Session session) {
+ if (log.isDebugEnabled()) {
+ log.debug("Stopping session with id [" + session.getId() + "]");
+ }
+ session.stop();
+ onStop(session);
+ notifyStop(session);
+ afterStopped(session);
+ }
+
+ protected void afterStopped(Session session) {
+ }
+
+ public Collection<Object> getAttributeKeys(Serializable sessionId) {
+ return getSession(sessionId).getAttributeKeys();
+ }
+
+ public Object getAttribute(Serializable sessionId, Object key) throws InvalidSessionException {
+ return getSession(sessionId).getAttribute(key);
+ }
+
+ public void setAttribute(Serializable sessionId, Object key, Object value) throws InvalidSessionException {
+ if (value == null) {
+ removeAttribute(sessionId, key);
+ } else {
+ Session s = getSession(sessionId);
+ s.setAttribute(key, value);
+ onChange(s);
+ }
+ }
+
+ public Object removeAttribute(Serializable sessionId, Object key) throws InvalidSessionException {
+ Session s = getSession(sessionId);
+ Object removed = s.removeAttribute(key);
+ if (removed != null) {
+ onChange(s);
+ }
+ return removed;
+ }
+
+ protected Session getSession(Serializable sessionId) throws InvalidSessionException {
+ if (sessionId == null) {
+ throw new IllegalArgumentException("sessionId parameter cannot be null.");
+ }
+ Session session = doGetSession(sessionId);
+ if (session == null) {
+ String msg = "There is no session with id [" + sessionId + "]";
+ throw new UnknownSessionException(msg);
+ }
+ return session;
+ }
+
+ public boolean isValid(Serializable sessionId) {
+ try {
+ checkValid(sessionId);
+ return true;
+ } catch (InvalidSessionException e) {
+ return false;
+ }
+ }
+
+ public void checkValid(Serializable sessionId) throws InvalidSessionException {
+ //just try to acquire it. If there is a problem, an exception will be thrown:
+ getSession(sessionId);
+ }
+
+ /**
+ * Template method that allows subclasses to react to a new session being created.
+ * <p/>
+ * This method is invoked <em>before</em> any session listeners are notified.
+ *
+ * @param session the session that was just {@link #createSession created}.
+ * @param context the {@link SessionContext SessionContext} that was used to start the session.
+ */
+ protected void onStart(Session session, SessionContext context) {
+ }
+
+ protected void onStop(Session session) {
+ onChange(session);
+ }
+
+ protected void onChange(Session s) {
+ }
+
+ protected abstract Session doGetSession(Serializable sessionId) throws InvalidSessionException;
+
+ /**
+ * Creates a new {@code Session Session} instance based on the specified (possibly {@code null})
+ * initialization data. Implementing classes must manage the persistent state of the returned session such that it
+ * could later be acquired via the {@link #getSession(java.io.Serializable)} method.
+ *
+ * @param context the initialization data that can be used by the implementation or underlying
+ * {@link SessionFactory} when instantiating the internal {@code Session} instance.
+ * @return the new {@code Session} instance.
+ * @throws org.apache.shiro.authz.HostUnauthorizedException
+ * if the system access control policy restricts access based
+ * on client location/IP and the specified hostAddress hasn't been enabled.
+ * @throws AuthorizationException if the system access control policy does not allow the currently executing
+ * caller to start sessions.
+ */
+ protected abstract Session createSession(SessionContext context) throws AuthorizationException;
+
+}
Modified: incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/AbstractSessionManager.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/AbstractSessionManager.java?rev=945518&r1=945517&r2=945518&view=diff
==============================================================================
--- incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/AbstractSessionManager.java (original)
+++ incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/AbstractSessionManager.java Tue May 18 06:36:55 2010
@@ -18,24 +18,9 @@
*/
package org.apache.shiro.session.mgt;
-import org.apache.shiro.authz.AuthorizationException;
-import org.apache.shiro.authz.HostUnauthorizedException;
-import org.apache.shiro.session.InvalidSessionException;
import org.apache.shiro.session.Session;
-import org.apache.shiro.session.SessionListener;
-import org.apache.shiro.session.UnknownSessionException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-
/**
- * TODO - complete JavaDoc
- *
* @author Les Hazlewood
* @since 0.1
*/
@@ -50,10 +35,7 @@ public abstract class AbstractSessionMan
*/
public static final long DEFAULT_GLOBAL_SESSION_TIMEOUT = 30 * MILLIS_PER_MINUTE;
- private static final Logger log = LoggerFactory.getLogger(AbstractSessionManager.class);
-
private long globalSessionTimeout = DEFAULT_GLOBAL_SESSION_TIMEOUT;
- private Collection<SessionListener> listeners = new ArrayList<SessionListener>();
public AbstractSessionManager() {
}
@@ -93,201 +75,4 @@ public abstract class AbstractSessionMan
public void setGlobalSessionTimeout(long globalSessionTimeout) {
this.globalSessionTimeout = globalSessionTimeout;
}
-
- public void setSessionListeners(Collection<SessionListener> listeners) {
- this.listeners = listeners != null ? listeners : new ArrayList<SessionListener>();
- }
-
- @SuppressWarnings({"UnusedDeclaration"})
- public Collection<SessionListener> getSessionListeners() {
- return this.listeners;
- }
-
- public Session start(SessionContext initData) throws AuthorizationException {
- Session session = createSession(initData);
- applyGlobalSessionTimeout(session);
- onStart(session);
- notifyStart(session);
- return new DelegatingSession(this, session.getId());
- }
-
- protected void applyGlobalSessionTimeout(Session session) {
- session.setTimeout(getGlobalSessionTimeout());
- onChange(session);
- }
-
- /**
- * Returns the session instance to use to pass to registered {@code SessionListener}s for notification
- * that the session has been invalidated (stopped or expired).
- * <p/>
- * The default implementation returns an {@link ImmutableProxiedSession ImmutableProxiedSession} instance to ensure
- * that the specified {@code session} argument is not modified by any listeners.
- *
- * @param session the {@code Session} object being invalidated.
- * @return the {@code Session} instance to use to pass to registered {@code SessionListener}s for notification.
- */
- protected Session beforeInvalidNotification(Session session) {
- return new ImmutableProxiedSession(session);
- }
-
- /**
- * Notifies any interested {@link SessionListener}s that a Session has started. This method is invoked
- * <em>after</em> the {@link #onStart(org.apache.shiro.session.Session)} method is called.
- *
- * @param session the session that has just started that will be delivered to any
- * {@link #setSessionListeners(java.util.Collection) registered} session listeners.
- * @see SessionListener#onStart(org.apache.shiro.session.Session)
- */
- protected void notifyStart(Session session) {
- for (SessionListener listener : this.listeners) {
- listener.onStart(session);
- }
- }
-
- protected void notifyStop(Session session) {
- Session forNotification = beforeInvalidNotification(session);
- for (SessionListener listener : this.listeners) {
- listener.onStop(forNotification);
- }
- }
-
- protected void notifyExpiration(Session session) {
- Session forNotification = beforeInvalidNotification(session);
- for (SessionListener listener : this.listeners) {
- listener.onExpiration(forNotification);
- }
- }
-
- public Date getStartTimestamp(Serializable sessionId) {
- return getSession(sessionId).getStartTimestamp();
- }
-
- public Date getLastAccessTime(Serializable sessionId) {
- return getSession(sessionId).getLastAccessTime();
- }
-
- public long getTimeout(Serializable sessionId) throws InvalidSessionException {
- return getSession(sessionId).getTimeout();
- }
-
- public void setTimeout(Serializable sessionId, long maxIdleTimeInMillis) throws InvalidSessionException {
- Session s = getSession(sessionId);
- s.setTimeout(maxIdleTimeInMillis);
- onChange(s);
- }
-
- public void touch(Serializable sessionId) throws InvalidSessionException {
- Session s = getSession(sessionId);
- s.touch();
- onChange(s);
- }
-
- public String getHost(Serializable sessionId) {
- return getSession(sessionId).getHost();
- }
-
- public void stop(Serializable sessionId) throws InvalidSessionException {
- Session session = getSession(sessionId);
- stop(session);
- }
-
- protected void stop(Session session) {
- if (log.isDebugEnabled()) {
- log.debug("Stopping session with id [" + session.getId() + "]");
- }
- session.stop();
- onStop(session);
- notifyStop(session);
- afterStopped(session);
- }
-
- protected void afterStopped(Session session) {
- }
-
- public Collection<Object> getAttributeKeys(Serializable sessionId) {
- return getSession(sessionId).getAttributeKeys();
- }
-
- public Object getAttribute(Serializable sessionId, Object key) throws InvalidSessionException {
- return getSession(sessionId).getAttribute(key);
- }
-
- public void setAttribute(Serializable sessionId, Object key, Object value) throws InvalidSessionException {
- if (value == null) {
- removeAttribute(sessionId, key);
- } else {
- Session s = getSession(sessionId);
- s.setAttribute(key, value);
- onChange(s);
- }
- }
-
- public Object removeAttribute(Serializable sessionId, Object key) throws InvalidSessionException {
- Session s = getSession(sessionId);
- Object removed = s.removeAttribute(key);
- if (removed != null) {
- onChange(s);
- }
- return removed;
- }
-
- protected Session getSession(Serializable sessionId) throws InvalidSessionException {
- if (sessionId == null) {
- throw new IllegalArgumentException("sessionId parameter cannot be null.");
- }
- Session session = doGetSession(sessionId);
- if (session == null) {
- String msg = "There is no session with id [" + sessionId + "]";
- throw new UnknownSessionException(msg);
- }
- return session;
- }
-
- public boolean isValid(Serializable sessionId) {
- try {
- checkValid(sessionId);
- return true;
- } catch (InvalidSessionException e) {
- return false;
- }
- }
-
- public void checkValid(Serializable sessionId) throws InvalidSessionException {
- //just try to acquire it. If there is a problem, an exception will be thrown:
- getSession(sessionId);
- }
-
- /**
- * Template method that allows subclasses to react to a new session being created.
- * <p/>
- * This method is invoked <em>before</em> any session listeners are notified.
- *
- * @param session the session that was just {@link #createSession created}.
- */
- protected void onStart(Session session) {
- }
-
- protected void onStop(Session session) {
- onChange(session);
- }
-
- protected void onChange(Session s) {
- }
-
- protected abstract Session doGetSession(Serializable sessionId) throws InvalidSessionException;
-
- /**
- * Creates a new {@code Session Session} instance based on the specified (possibly {@code null})
- * initialization data. Implementing classes must manage the persistent state of the returned session such that it
- * could later be acquired via the {@link #getSession(java.io.Serializable)} method.
- *
- * @param initData the initialization data that can be used by the implementation or underlying
- * {@link SessionFactory} when instantiating the internal {@code Session} instance.
- * @return the new {@code Session} instance.
- * @throws HostUnauthorizedException if the system access control policy restricts access based
- * on client location/IP and the specified hostAddress hasn't been enabled.
- * @throws AuthorizationException if the system access control policy does not allow the currently executing
- * caller to start sessions.
- */
- protected abstract Session createSession(SessionContext initData) throws AuthorizationException;
}
Modified: incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/AbstractValidatingSessionManager.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/AbstractValidatingSessionManager.java?rev=945518&r1=945517&r2=945518&view=diff
==============================================================================
--- incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/AbstractValidatingSessionManager.java (original)
+++ incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/AbstractValidatingSessionManager.java Tue May 18 06:36:55 2010
@@ -39,7 +39,7 @@ import java.util.Collection;
* @author Jeremy Haile
* @since 0.1
*/
-public abstract class AbstractValidatingSessionManager extends AbstractSessionManager
+public abstract class AbstractValidatingSessionManager extends AbstractNativeSessionManager
implements ValidatingSessionManager, Destroyable {
//TODO - complete JavaDoc
@@ -117,16 +117,10 @@ public abstract class AbstractValidating
if (log.isTraceEnabled()) {
log.trace("Attempting to retrieve session with id [" + sessionId + "]");
}
- Session s;
- try {
- s = retrieveSession(sessionId);
- if (s == null) {
- throw new UnknownSessionException("The session data store did not return a session for " +
- "sessionId [" + sessionId + "]", sessionId);
- }
- } catch (UnknownSessionException e) {
- onUnknownSession(sessionId);
- throw e;
+ Session s = retrieveSession(sessionId);
+ if (s == null) {
+ throw new UnknownSessionException("The session data store did not return a session for " +
+ "sessionId [" + sessionId + "]", sessionId);
}
validate(s);
return s;
@@ -141,9 +135,9 @@ public abstract class AbstractValidating
*/
protected abstract Session retrieveSession(Serializable sessionId) throws UnknownSessionException;
- protected Session createSession(SessionContext initData) throws AuthorizationException {
+ protected Session createSession(SessionContext context) throws AuthorizationException {
enableSessionValidationIfNecessary();
- return doCreateSession(initData);
+ return doCreateSession(context);
}
protected abstract Session doCreateSession(SessionContext initData) throws AuthorizationException;
@@ -182,20 +176,6 @@ public abstract class AbstractValidating
afterStopped(s);
}
- /**
- * Notification callback for subclasses that occurs when a client attempts to reference the session with the
- * specified ID, but there does not exist any session with that id.
- * <p/>
- * A common case of this occurring is if the client's referenced session times out and is deleted before the next
- * time they interact with the system (such as often occurs with stale session id cookies in an web environment).
- * The next time they send a request with the stale session id, this method would be called.
- *
- * @param sessionId the session id used to try and reference the non-existent session.
- * @since 1.0
- */
- public void onUnknownSession(Serializable sessionId) {
- }
-
protected void onExpiration(Session session) {
onChange(session);
}
Modified: incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/DefaultSessionContext.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/DefaultSessionContext.java?rev=945518&r1=945517&r2=945518&view=diff
==============================================================================
--- incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/DefaultSessionContext.java (original)
+++ incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/DefaultSessionContext.java Tue May 18 06:36:55 2010
@@ -21,6 +21,7 @@ package org.apache.shiro.session.mgt;
import org.apache.shiro.util.MapContext;
import org.apache.shiro.util.StringUtils;
+import java.io.Serializable;
import java.util.Map;
/**
@@ -35,6 +36,7 @@ public class DefaultSessionContext exten
private static final long serialVersionUID = -1424160751361252966L;
private static final String HOST = DefaultSessionContext.class.getName() + ".HOST";
+ private static final String SESSION_ID = DefaultSessionContext.class.getName() + ".SESSION_ID";
public DefaultSessionContext() {
super();
@@ -44,13 +46,21 @@ public class DefaultSessionContext exten
super(map);
}
+ public String getHost() {
+ return getTypedValue(HOST, String.class);
+ }
+
public void setHost(String host) {
if (StringUtils.hasText(host)) {
put(HOST, host);
}
}
- public String getHost() {
- return getTypedValue(HOST, String.class);
+ public Serializable getSessionId() {
+ return getTypedValue(SESSION_ID, Serializable.class);
+ }
+
+ public void setSessionId(Serializable sessionId) {
+ nullSafePut(SESSION_ID, sessionId);
}
}
Modified: incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/DefaultSessionManager.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/DefaultSessionManager.java?rev=945518&r1=945517&r2=945518&view=diff
==============================================================================
--- incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/DefaultSessionManager.java (original)
+++ incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/DefaultSessionManager.java Tue May 18 06:36:55 2010
@@ -151,8 +151,8 @@ public class DefaultSessionManager exten
}
}
- protected Session doCreateSession(SessionContext initData) {
- Session s = newSessionInstance(initData);
+ protected Session doCreateSession(SessionContext context) {
+ Session s = newSessionInstance(context);
if (log.isTraceEnabled()) {
log.trace("Creating session for host {}", s.getHost());
}
@@ -160,8 +160,8 @@ public class DefaultSessionManager exten
return s;
}
- protected Session newSessionInstance(SessionContext initData) {
- return getSessionFactory().createSession(initData);
+ protected Session newSessionInstance(SessionContext context) {
+ return getSessionFactory().createSession(context);
}
/**
Modified: incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/DelegatingSession.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/DelegatingSession.java?rev=945518&r1=945517&r2=945518&view=diff
==============================================================================
--- incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/DelegatingSession.java (original)
+++ incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/DelegatingSession.java Tue May 18 06:36:55 2010
@@ -28,13 +28,13 @@ import java.util.Date;
/**
* A DelegatingSession is a client-tier representation of a server side
* {@link org.apache.shiro.session.Session Session}.
- * This implementation is basically a proxy to a server-side {@link SessionManager SessionManager},
+ * This implementation is basically a proxy to a server-side {@link NativeSessionManager NativeSessionManager},
* which will return the proper results for each method call.
* <p/>
* <p>A <tt>DelegatingSession</tt> will cache data when appropriate to avoid a remote method invocation,
* only communicating with the server when necessary.
* <p/>
- * <p>Of course, if used in-process with a SessionManager business POJO, as might be the case in a
+ * <p>Of course, if used in-process with a NativeSessionManager business POJO, as might be the case in a
* web-based application where the web classes and server-side business pojos exist in the same
* JVM, a remote method call will not be incurred.
*
@@ -55,13 +55,13 @@ public class DelegatingSession implement
/**
* Handle to a server-side SessionManager. See {@link #setSessionManager} for details.
*/
- private transient SessionManager sessionManager = null;
+ private transient NativeSessionManager sessionManager = null;
public DelegatingSession() {
}
- public DelegatingSession(SessionManager sessionManager, Serializable id) {
+ public DelegatingSession(NativeSessionManager sessionManager, Serializable id) {
if (sessionManager == null) {
throw new IllegalArgumentException("sessionManager argument cannot be null.");
}
@@ -72,7 +72,7 @@ public class DelegatingSession implement
this.id = id;
}
- public DelegatingSession(SessionManager sessionManager, Serializable id, String host) {
+ public DelegatingSession(NativeSessionManager sessionManager, Serializable id, String host) {
this(sessionManager, id);
this.host = host;
}
@@ -84,12 +84,12 @@ public class DelegatingSession implement
* @return the {@link SessionManager SessionManager} used by this handle to invoke
* all session-related methods.
*/
- public SessionManager getSessionManager() {
+ public NativeSessionManager getSessionManager() {
return sessionManager;
}
/**
- * Sets the {@link SessionManager SessionManager} to which this <tt>DelegatingSession</tt> will
+ * Sets the {@link NativeSessionManager NativeSessionManager} to which this <tt>DelegatingSession</tt> will
* delegate its method calls. In a rich client environment, this <tt>SessionManager</tt> will
* probably be a remoting proxy which executes remote method invocations. In a single-process
* environment (e.g. a web application deployed in the same JVM of the application server),
@@ -104,16 +104,16 @@ public class DelegatingSession implement
* @param sessionManager the <tt>SessionManager</tt> this handle will use when delegating
* method calls.
*/
- public void setSessionManager(SessionManager sessionManager) {
+ public void setSessionManager(NativeSessionManager sessionManager) {
this.sessionManager = sessionManager;
}
/**
- * Sets the sessionId used by this handle for all future {@link SessionManager SessionManager}
+ * Sets the sessionId used by this handle for all future {@link NativeSessionManager NativeSessionManager}
* method invocations.
*
- * @param id the <tt>sessionId</tt> to use for all <tt>SessionManager</tt> invocations.
- * @see #setSessionManager(SessionManager sessionManager)
+ * @param id the <tt>sessionId</tt> to use for all <tt>NativeSessionManager</tt> invocations.
+ * @see #setSessionManager(NativeSessionManager nativeSessionManager)
*/
public void setId(Serializable id) {
this.id = id;
Added: incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/NativeSessionManager.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/NativeSessionManager.java?rev=945518&view=auto
==============================================================================
--- incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/NativeSessionManager.java (added)
+++ incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/NativeSessionManager.java Tue May 18 06:36:55 2010
@@ -0,0 +1,195 @@
+/*
+ * Copyright 2008 Les Hazlewood
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.shiro.session.mgt;
+
+import org.apache.shiro.session.InvalidSessionException;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.Date;
+
+/**
+ * A {@code Native} session manager is one that manages sessions natively - that is, it is directly responsible
+ * for the creation, persistence and removal of {@link org.apache.shiro.session.Session Session} instances and their
+ * lifecycles.
+ *
+ * @author Les Hazlewood
+ * @since 1.0
+ */
+public interface NativeSessionManager extends SessionManager {
+
+ /**
+ * Returns the time the Session identified by the specified {@code sessionId} was started
+ * in the system.
+ *
+ * @param sessionId the system identifier for the session of interest.
+ * @return the system time the specified session was started (i.e. created).
+ * @see org.apache.shiro.session.Session#getStartTimestamp()
+ */
+ Date getStartTimestamp(Serializable sessionId);
+
+ /**
+ * Returns the time the {@code Session} identified by the specified {@code sessionId} last
+ * interacted with the system.
+ *
+ * @param sessionId the system identifier for the session of interest
+ * @return time the session last accessed the system
+ * @see org.apache.shiro.session.Session#getLastAccessTime()
+ * @see org.apache.shiro.session.Session#touch()
+ */
+ Date getLastAccessTime(Serializable sessionId);
+
+ /**
+ * Returns {@code true} if the session is valid (it exists and is not stopped nor expired), {@code false} otherwise.
+ *
+ * @param sessionId the id of the session to check
+ * @return {@code true} if the session is valid (exists and is not stopped or expired), {@code false} otherwise.
+ */
+ boolean isValid(Serializable sessionId);
+
+ /**
+ * Returns quietly if the associated session is valid (it exists and is not stopped or expired) or throws
+ * an {@link org.apache.shiro.session.InvalidSessionException} indicating that the session id is invalid. This might be preferred to be
+ * used instead of {@link #isValid} since any exception thrown will definitively explain the reason for
+ * invalidation.
+ *
+ * @param sessionId the session id to check for validity.
+ * @throws org.apache.shiro.session.InvalidSessionException
+ * if the session id is invalid (it does not exist or it is stopped or expired).
+ * @since 1.0
+ */
+ void checkValid(Serializable sessionId) throws InvalidSessionException;
+
+ /**
+ * Returns the time in milliseconds that the specified session may remain idle before expiring.
+ * <ul>
+ * <li>A negative return value means the session will never expire.</li>
+ * <li>A non-negative return value (0 or greater) means the session expiration will occur if idle for that
+ * length of time.</li>
+ * </ul>
+ *
+ * @param sessionId the system identifier of the session of interest.
+ * @return the time in milliseconds that the specified session may remain idle before expiring.
+ * @throws org.apache.shiro.session.InvalidSessionException
+ * if the session has been stopped or expired prior to calling this method.
+ * @since 0.2
+ */
+ long getTimeout(Serializable sessionId) throws InvalidSessionException;
+
+ /**
+ * Sets the time in milliseconds that the specified session may remain idle before expiring.
+ * <ul>
+ * <li>A negative return value means the session will never expire.</li>
+ * <li>A non-negative return value (0 or greater) means the session expiration will occur if idle for that
+ * length of time.</li>
+ * </ul>
+ *
+ * @param sessionId the system identifier of the session of interest.
+ * @param maxIdleTimeInMillis the time in milliseconds that the specified session may remain idle before expiring.
+ * @throws org.apache.shiro.session.InvalidSessionException
+ * if the session has been stopped or expired prior to calling this method.
+ * @since 0.2
+ */
+ void setTimeout(Serializable sessionId, long maxIdleTimeInMillis) throws InvalidSessionException;
+
+ /**
+ * Updates the last accessed time of the session identified by <code>sessionId</code>. This
+ * can be used to explicitly ensure that a session does not time out.
+ *
+ * @param sessionId the id of the session to update.
+ * @throws org.apache.shiro.session.InvalidSessionException
+ * if the session has been stopped or expired prior to calling this method.
+ * @see org.apache.shiro.session.Session#touch
+ */
+ void touch(Serializable sessionId) throws InvalidSessionException;
+
+ /**
+ * Returns the host name or IP string of the host where the session was started, if known. If
+ * no host name or IP was specified when starting the session, this method returns {@code null}
+ *
+ * @param sessionId the id of the session to query.
+ * @return the host name or ip address of the host where the session originated, if known. If unknown,
+ * this method returns {@code null}.
+ * @since 1.0
+ */
+ String getHost(Serializable sessionId);
+
+ /**
+ * Explicitly stops the session identified by {@code sessionId}, thereby releasing all
+ * associated resources.
+ *
+ * @param sessionId the system identfier of the system to destroy.
+ * @throws InvalidSessionException if the session has stopped or expired prior to calling
+ * this method.
+ * @see org.apache.shiro.session.Session#stop
+ */
+ void stop(Serializable sessionId) throws InvalidSessionException;
+
+ /**
+ * Returns the keys of all the attributes stored under the session identified by {@code sessionId}.
+ * If there are no attributes, this returns an empty collection.
+ *
+ * @param sessionId the system identifier of the system to access.
+ * @return the keys of all attributes stored under the specified session, or an empty collection if
+ * there are no session attributes.
+ * @throws InvalidSessionException if the specified session has stopped or expired prior to calling this method.
+ * @see org.apache.shiro.session.Session#getAttributeKeys()
+ * @since 0.2
+ */
+ Collection<Object> getAttributeKeys(Serializable sessionId);
+
+ /**
+ * Returns the object bound to the specified session identified by the specified key. If there
+ * is noobject bound under the key for the given session, {@code null} is returned.
+ *
+ * @param sessionId the system identifier of the session of interest
+ * @param key the unique name of the object bound to the specified session
+ * @return the object bound under the specified {@code key} name or {@code null} if there is
+ * no object bound under that name.
+ * @throws InvalidSessionException if the specified session has stopped or expired prior to calling this method.
+ * @see org.apache.shiro.session.Session#getAttribute(Object key)
+ */
+ Object getAttribute(Serializable sessionId, Object key) throws InvalidSessionException;
+
+ /**
+ * Binds the specified {@code value} to the specified session uniquely identified by the
+ * specifed {@code key} name. If there is already an object bound under the {@code key}
+ * name, that existing object will be replaced by the new {@code value}.
+ * <p/>
+ * If the {@code value} parameter is null, it has the same effect as if the
+ * {@link #removeAttribute(Serializable sessionId, Object key)} method was called.
+ *
+ * @param sessionId the system identifier of the session of interest
+ * @param key the name under which the {@code value} object will be bound in this session
+ * @param value the object to bind in this session.
+ * @throws InvalidSessionException if the specified session has stopped or expired prior to calling this method.
+ * @see org.apache.shiro.session.Session#setAttribute(Object key, Object value)
+ */
+ void setAttribute(Serializable sessionId, Object key, Object value) throws InvalidSessionException;
+
+ /**
+ * Removes (unbinds) the object bound to this session under the specified {@code key} name.
+ *
+ * @param sessionId the system identifier of the session of interest
+ * @param key the name uniquely identifying the object to remove
+ * @return the object removed or {@code null} if there was no object bound under the specified
+ * {@code key} name.
+ * @throws InvalidSessionException if the specified session has stopped or expired prior to calling this method.
+ * @see org.apache.shiro.session.Session#removeAttribute(Object key)
+ */
+ Object removeAttribute(Serializable sessionId, Object key) throws InvalidSessionException;
+
+}
Modified: incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/SessionContext.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/SessionContext.java?rev=945518&r1=945517&r2=945518&view=diff
==============================================================================
--- incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/SessionContext.java (original)
+++ incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/SessionContext.java Tue May 18 06:36:55 2010
@@ -18,6 +18,7 @@
*/
package org.apache.shiro.session.mgt;
+import java.io.Serializable;
import java.util.Map;
/**
@@ -83,4 +84,9 @@ public interface SessionContext extends
* @see #setHost(String) setHost(String)
*/
String getHost();
+
+ Serializable getSessionId();
+
+ void setSessionId(Serializable sessionId);
+
}
Modified: incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/SessionManager.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/SessionManager.java?rev=945518&r1=945517&r2=945518&view=diff
==============================================================================
--- incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/SessionManager.java (original)
+++ incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/session/mgt/SessionManager.java Tue May 18 06:36:55 2010
@@ -18,14 +18,8 @@
*/
package org.apache.shiro.session.mgt;
-import org.apache.shiro.authz.AuthorizationException;
-import org.apache.shiro.authz.HostUnauthorizedException;
-import org.apache.shiro.session.InvalidSessionException;
import org.apache.shiro.session.Session;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.Date;
+import org.apache.shiro.session.SessionException;
/**
* A SessionManager manages the creation, maintenance, and clean-up of all application
@@ -45,175 +39,24 @@ public interface SessionManager {
* instance in a specific manner. This allows pluggable {@link org.apache.shiro.session.Session Session} creation
* logic by simply injecting a {@code SessionFactory} into the {@code SessionManager} instance.
*
- * @param initData the contextual initialization data that can be used by the implementation or underlying
- * {@link SessionFactory} when instantiating the internal {@code Session} instance.
+ * @param context the contextual initialization data that can be used by the implementation or underlying
+ * {@link SessionFactory} when instantiating the internal {@code Session} instance.
* @return the newly created session.
- * @throws HostUnauthorizedException if the system access control policy restricts access based
- * on client location/IP and the specified host address hasn't been enabled.
- * @throws AuthorizationException if the system access control policy does not allow the currently executing
- * caller to start sessions.
* @see SessionFactory#createSession(SessionContext)
* @since 1.0
*/
- Session start(SessionContext initData) throws AuthorizationException;
-
- /**
- * Returns the time the Session identified by the specified {@code sessionId} was started
- * in the system.
- *
- * @param sessionId the system identifier for the session of interest.
- * @return the system time the specified session was started (i.e. created).
- * @see org.apache.shiro.session.Session#getStartTimestamp()
- */
- Date getStartTimestamp(Serializable sessionId);
-
- /**
- * Returns the time the {@code Session} identified by the specified {@code sessionId} last
- * interacted with the system.
- *
- * @param sessionId the system identifier for the session of interest
- * @return time the session last accessed the system
- * @see org.apache.shiro.session.Session#getLastAccessTime()
- * @see org.apache.shiro.session.Session#touch()
- */
- Date getLastAccessTime(Serializable sessionId);
-
- /**
- * Returns {@code true} if the session is valid (it exists and is not stopped nor expired), {@code false} otherwise.
- *
- * @param sessionId the id of the session to check
- * @return {@code true} if the session is valid (exists and is not stopped or expired), {@code false} otherwise.
- */
- boolean isValid(Serializable sessionId);
+ Session start(SessionContext context);
/**
- * Returns quietly if the associated session is valid (it exists and is not stopped or expired) or throws
- * an {@link InvalidSessionException} indicating that the session id is invalid. This might be preferred to be
- * used instead of {@link #isValid} since any exception thrown will definitively explain the reason for
- * invalidation.
+ * Retrieves the session corresponding to the specified contextual data (such as a session ID if applicable), or
+ * {@code null} if no Session could be found. If a session is found but invalid (stopped or expired), a
+ * {@link SessionException} will be thrown.
*
- * @param sessionId the session id to check for validity.
- * @throws InvalidSessionException if the session id is invalid (it does not exist or it is stopped or expired).
+ * @param context the context data that can be used for lookup data to acquire the Session
+ * @return the {@code Session} instance corresponding to the given context lookup data or {@code null} if no session
+ * could be acquired.
+ * @throws SessionException if a session was found but it was invalid (stopped/expired).
* @since 1.0
*/
- void checkValid(Serializable sessionId) throws InvalidSessionException;
-
- /**
- * Returns the time in milliseconds that the specified session may remain idle before expiring.
- * <ul>
- * <li>A negative return value means the session will never expire.</li>
- * <li>A non-negative return value (0 or greater) means the session expiration will occur if idle for that
- * length of time.</li>
- * </ul>
- *
- * @param sessionId the system identifier of the session of interest.
- * @return the time in milliseconds that the specified session may remain idle before expiring.
- * @throws org.apache.shiro.session.InvalidSessionException
- * if the session has been stopped or expired prior to calling this method.
- * @since 0.2
- */
- long getTimeout(Serializable sessionId) throws InvalidSessionException;
-
- /**
- * Sets the time in milliseconds that the specified session may remain idle before expiring.
- * <ul>
- * <li>A negative return value means the session will never expire.</li>
- * <li>A non-negative return value (0 or greater) means the session expiration will occur if idle for that
- * length of time.</li>
- * </ul>
- *
- * @param sessionId the system identifier of the session of interest.
- * @param maxIdleTimeInMillis the time in milliseconds that the specified session may remain idle before expiring.
- * @throws org.apache.shiro.session.InvalidSessionException
- * if the session has been stopped or expired prior to calling this method.
- * @since 0.2
- */
- void setTimeout(Serializable sessionId, long maxIdleTimeInMillis) throws InvalidSessionException;
-
- /**
- * Updates the last accessed time of the session identified by <code>sessionId</code>. This
- * can be used to explicitly ensure that a session does not time out.
- *
- * @param sessionId the id of the session to update.
- * @throws org.apache.shiro.session.InvalidSessionException
- * if the session has been stopped or expired prior to calling this method.
- * @see org.apache.shiro.session.Session#touch
- */
- void touch(Serializable sessionId) throws InvalidSessionException;
-
- /**
- * Returns the host name or IP string of the host where the session was started, if known. If
- * no host name or IP was specified when starting the session, this method returns {@code null}
- *
- * @param sessionId the id of the session to query.
- * @return the host name or ip address of the host where the session originated, if known. If unknown,
- * this method returns {@code null}.
- * @since 1.0
- */
- String getHost(Serializable sessionId);
-
- /**
- * Explicitly stops the session identified by {@code sessionId}, thereby releasing all
- * associated resources.
- *
- * @param sessionId the system identfier of the system to destroy.
- * @throws InvalidSessionException if the session has stopped or expired prior to calling
- * this method.
- * @see org.apache.shiro.session.Session#stop
- */
- void stop(Serializable sessionId) throws InvalidSessionException;
-
- /**
- * Returns the keys of all the attributes stored under the session identified by {@code sessionId}.
- * If there are no attributes, this returns an empty collection.
- *
- * @param sessionId the system identifier of the system to access.
- * @return the keys of all attributes stored under the specified session, or an empty collection if
- * there are no session attributes.
- * @throws InvalidSessionException if the specified session has stopped or expired prior to calling this method.
- * @see org.apache.shiro.session.Session#getAttributeKeys()
- * @since 0.2
- */
- Collection<Object> getAttributeKeys(Serializable sessionId);
-
- /**
- * Returns the object bound to the specified session identified by the specified key. If there
- * is noobject bound under the key for the given session, {@code null} is returned.
- *
- * @param sessionId the system identifier of the session of interest
- * @param key the unique name of the object bound to the specified session
- * @return the object bound under the specified {@code key} name or {@code null} if there is
- * no object bound under that name.
- * @throws InvalidSessionException if the specified session has stopped or expired prior to calling this method.
- * @see org.apache.shiro.session.Session#getAttribute(Object key)
- */
- Object getAttribute(Serializable sessionId, Object key) throws InvalidSessionException;
-
- /**
- * Binds the specified {@code value} to the specified session uniquely identified by the
- * specifed {@code key} name. If there is already an object bound under the {@code key}
- * name, that existing object will be replaced by the new {@code value}.
- * <p/>
- * If the {@code value} parameter is null, it has the same effect as if the
- * {@link #removeAttribute(Serializable sessionId, Object key)} method was called.
- *
- * @param sessionId the system identifier of the session of interest
- * @param key the name under which the {@code value} object will be bound in this session
- * @param value the object to bind in this session.
- * @throws InvalidSessionException if the specified session has stopped or expired prior to calling this method.
- * @see org.apache.shiro.session.Session#setAttribute(Object key, Object value)
- */
- void setAttribute(Serializable sessionId, Object key, Object value) throws InvalidSessionException;
-
- /**
- * Removes (unbinds) the object bound to this session under the specified {@code key} name.
- *
- * @param sessionId the system identifier of the session of interest
- * @param key the name uniquely identifying the object to remove
- * @return the object removed or {@code null} if there was no object bound under the specified
- * {@code key} name.
- * @throws InvalidSessionException if the specified session has stopped or expired prior to calling this method.
- * @see org.apache.shiro.session.Session#removeAttribute(Object key)
- */
- Object removeAttribute(Serializable sessionId, Object key) throws InvalidSessionException;
+ Session getSession(SessionContext context) throws SessionException;
}
Modified: incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/subject/support/DefaultSubjectContext.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/subject/support/DefaultSubjectContext.java?rev=945518&r1=945517&r2=945518&view=diff
==============================================================================
--- incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/subject/support/DefaultSubjectContext.java (original)
+++ incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/subject/support/DefaultSubjectContext.java Tue May 18 06:36:55 2010
@@ -91,9 +91,7 @@ public class DefaultSubjectContext exten
}
public void setSecurityManager(SecurityManager securityManager) {
- if (securityManager != null) {
- put(SECURITY_MANAGER, securityManager);
- }
+ nullSafePut(SECURITY_MANAGER, securityManager);
}
public SecurityManager resolveSecurityManager() {
@@ -119,9 +117,7 @@ public class DefaultSubjectContext exten
}
public void setSessionId(Serializable sessionId) {
- if (sessionId != null) {
- put(SESSION_ID, sessionId);
- }
+ nullSafePut(SESSION_ID, sessionId);
}
public Subject getSubject() {
@@ -129,9 +125,7 @@ public class DefaultSubjectContext exten
}
public void setSubject(Subject subject) {
- if (subject != null) {
- put(SUBJECT, subject);
- }
+ nullSafePut(SUBJECT, subject);
}
public PrincipalCollection getPrincipals() {
@@ -179,9 +173,7 @@ public class DefaultSubjectContext exten
}
public void setSession(Session session) {
- if (session != null) {
- put(SESSION, session);
- }
+ nullSafePut(SESSION, session);
}
public Session resolveSession() {
@@ -230,9 +222,7 @@ public class DefaultSubjectContext exten
}
public void setAuthenticationInfo(AuthenticationInfo info) {
- if (info != null) {
- put(AUTHENTICATION_INFO, info);
- }
+ nullSafePut(AUTHENTICATION_INFO, info);
}
public AuthenticationToken getAuthenticationToken() {
@@ -240,9 +230,7 @@ public class DefaultSubjectContext exten
}
public void setAuthenticationToken(AuthenticationToken token) {
- if (token != null) {
- put(AUTHENTICATION_TOKEN, token);
- }
+ nullSafePut(AUTHENTICATION_TOKEN, token);
}
public String getHost() {
Modified: incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java?rev=945518&r1=945517&r2=945518&view=diff
==============================================================================
--- incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java (original)
+++ incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java Tue May 18 06:36:55 2010
@@ -29,7 +29,6 @@ import org.apache.shiro.session.InvalidS
import org.apache.shiro.session.ProxiedSession;
import org.apache.shiro.session.Session;
import org.apache.shiro.session.mgt.DefaultSessionContext;
-import org.apache.shiro.session.mgt.DelegatingSession;
import org.apache.shiro.session.mgt.SessionContext;
import org.apache.shiro.subject.ExecutionException;
import org.apache.shiro.subject.PrincipalCollection;
@@ -115,14 +114,6 @@ public class DelegatingSubject implement
return new StoppingAwareProxiedSession(session, this);
}
- protected Session decorateSession(Serializable sessionId) {
- if (sessionId == null) {
- throw new IllegalArgumentException("sessionId cannot be null");
- }
- DelegatingSession target = new DelegatingSession(getSecurityManager(), sessionId);
- return decorate(target);
- }
-
public SecurityManager getSecurityManager() {
return securityManager;
}
Modified: incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/util/MapContext.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/util/MapContext.java?rev=945518&r1=945517&r2=945518&view=diff
==============================================================================
--- incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/util/MapContext.java (original)
+++ incubator/shiro/branches/session_manager_API_change/core/src/main/java/org/apache/shiro/util/MapContext.java Tue May 18 06:36:55 2010
@@ -27,17 +27,17 @@ import java.util.*;
* @author Les Hazlewood
* @since 1.0
*/
-public class MapContext implements Map<String,Object>, Serializable {
+public class MapContext implements Map<String, Object>, Serializable {
private static final long serialVersionUID = 5373399119017820322L;
-
- private final Map<String,Object> backingMap;
+
+ private final Map<String, Object> backingMap;
public MapContext() {
this.backingMap = new HashMap<String, Object>();
}
- public MapContext(Map<String,Object> map) {
+ public MapContext(Map<String, Object> map) {
this();
if (!CollectionUtils.isEmpty(map)) {
this.backingMap.putAll(map);
@@ -60,6 +60,12 @@ public class MapContext implements Map<S
return found;
}
+ protected void nullSafePut(String key, Object value) {
+ if (value != null) {
+ put(key, value);
+ }
+ }
+
public int size() {
return backingMap.size();
}
Modified: incubator/shiro/branches/session_manager_API_change/pom.xml
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/session_manager_API_change/pom.xml?rev=945518&r1=945517&r2=945518&view=diff
==============================================================================
--- incubator/shiro/branches/session_manager_API_change/pom.xml (original)
+++ incubator/shiro/branches/session_manager_API_change/pom.xml Tue May 18 06:36:55 2010
@@ -73,6 +73,37 @@
<groovy.version>1.6.2</groovy.version>
</properties>
+ <mailingLists>
+ <mailingList>
+ <name>Apache Shiro Users Mailing List</name>
+ <subscribe>shiro-user-subscribe@incubator.apache.org</subscribe>
+ <unsubscribe>shiro-user-unsubscribe@incubator.apache.org</unsubscribe>
+ <post>shiro-user@incubator.apache.org</post>
+ <!--archive/-->
+ <!--otherArchives-->
+ </mailingList>
+ <mailingList>
+ <name>Apache Shiro Developers Mailing List</name>
+ <subscribe>shiro-dev-subscribe@incubator.apache.org</subscribe>
+ <unsubscribe>shiro-dev-unsubscribe@incubator.apache.org</unsubscribe>
+ <post>shiro-dev@incubator.apache.org</post>
+ <!--archive/-->
+ <!--otherArchives-->
+ </mailingList>
+ </mailingLists>
+
+
+ <developers>
+ <developer>
+ <id>kaosko</id>
+ <name>Kalle Korhonen</name>
+ <email>kaosko@apache.org</email>
+ <url>http://tynamo.org</url>
+ <organization>Apache Software Foundation</organization>
+ <timezone>-8</timezone>
+ </developer>
+ </developers>
+
<modules>
<module>core</module>
<module>web</module>
@@ -398,11 +429,9 @@
<reporting>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>2.6.1</version>
+ <version>2.7</version>
<configuration>
- <aggregate>true</aggregate>
<source>${jdk.version}</source>
<encoding>${project.build.sourceEncoding}</encoding>
<linksource>true</linksource>
@@ -417,17 +446,96 @@
</links>
<!-- Don't include the sample apps - they're not part of Shiro's API: -->
<excludePackageNames>org.apache.shiro.samples.*</excludePackageNames>
- <reportSets>
- <reportSet>
- <id>aggregate</id>
- <configuration>
- </configuration>
- <reports>
- <report>aggregate</report>
- </reports>
- </reportSet>
- </reportSets>
</configuration>
+ <reportSets>
+ <reportSet>
+ <id>javadoc-aggregate</id>
+ <reports>
+ <report>aggregate</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <version>2.4</version>
+ <configuration>
+ <formats>
+ <format>xml</format>
+ <format>html</format>
+ </formats>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jxr-plugin</artifactId>
+ <version>2.1</version>
+ <configuration>
+ <aggregate>true</aggregate>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-pmd-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <linkXref>true</linkXref>
+ <sourceEncoding>utf-8</sourceEncoding>
+ <targetJdk>1.5</targetJdk>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <!-- Disable, just to make it go faster -->
+ <configuration>
+ <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <version>2.5</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>taglist-maven-plugin</artifactId>
+ <version>2.4</version>
+ <configuration>
+ <tagListOptions>
+ <tagClasses>
+ <tagClass>
+ <displayName>Todo Work</displayName>
+ <tags>
+ <tag>
+ <matchString>todo</matchString>
+ <matchType>ignoreCase</matchType>
+ </tag>
+ <tag>
+ <matchString>FIXME</matchString>
+ <matchType>exact</matchType>
+ </tag>
+ </tags>
+ </tagClass>
+ <tagClass>
+ <displayName>Deprecated</displayName>
+ <tags>
+ <tag>
+ <matchString>@Deprecated</matchString>
+ <matchType>exact</matchType>
+ </tag>
+ </tags>
+ </tagClass>
+ </tagClasses>
+ </tagListOptions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jdepend-maven-plugin</artifactId>
+ <version>2.0-beta-2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>dashboard-maven-plugin</artifactId>
+ <version>1.0.0-beta-1</version>
</plugin>
</plugins>
</reporting>
@@ -469,14 +577,14 @@
</build>
</profile>
<profile>
- <id>release-profile</id>
- <distributionManagement>
- <site>
- <id>incubator.website</id>
- <name>Apache Incubator Site</name>
- <url>scp://people.apache.org/www/incubator.apache.org/shiro/site/${project.version}</url>
- </site>
- </distributionManagement>
+ <id>release-profile</id>
+ <distributionManagement>
+ <site>
+ <id>incubator.website</id>
+ <name>Apache Incubator Site</name>
+ <url>scp://people.apache.org/www/incubator.apache.org/shiro/site/${project.version}</url>
+ </site>
+ </distributionManagement>
</profile>
</profiles>
</project>
Modified: incubator/shiro/branches/session_manager_API_change/samples/pom.xml
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/session_manager_API_change/samples/pom.xml?rev=945518&r1=945517&r2=945518&view=diff
==============================================================================
--- incubator/shiro/branches/session_manager_API_change/samples/pom.xml (original)
+++ incubator/shiro/branches/session_manager_API_change/samples/pom.xml Tue May 18 06:36:55 2010
@@ -36,10 +36,20 @@
<module>aspectj</module>
<module>quickstart</module>
<module>web</module>
- <module>spring-client</module>
- <module>spring</module>
+ <module>spring-client</module>
+ <module>spring</module>
<module>spring-hibernate</module>
</modules>
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
</project>