|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.turbine.services.BaseInitable
org.apache.turbine.services.BaseService
org.apache.turbine.services.TurbineBaseService
org.apache.turbine.services.session.TurbineSessionService
The SessionService allows thread-safe access to the current
sessions of the current context. The session objects that are
cached by this service are obtained through a listener, which must
be configured via your web application's web.xml
deployement descriptor as follows:
<listener>
<listener-class>
org.apache.turbine.session.SessionListener
</listener-class>
</listener>
TurbineSession
,
SessionListener
Field Summary |
Fields inherited from class org.apache.turbine.services.BaseService |
configuration, name, serviceBroker |
Fields inherited from class org.apache.turbine.services.BaseInitable |
initableBroker, isInitialized |
Fields inherited from interface org.apache.turbine.services.session.SessionService |
SERVICE_NAME |
Constructor Summary | |
TurbineSessionService()
|
Method Summary | |
void |
addSession(javax.servlet.http.HttpSession session)
Adds a session to the current list. |
java.util.Collection |
getActiveSessions()
Gets a list of the active sessions. |
java.util.Collection |
getActiveUsers()
Gets a collection of all user objects representing the users currently logged in. |
javax.servlet.http.HttpSession |
getSession(java.lang.String sessionId)
Gets the HttpSession by the session identifier |
java.util.Collection |
getSessionsForUser(User user)
Get a collection of all session on which the given user is logged in. |
User |
getUserFromSession(javax.servlet.http.HttpSession session)
Gets the User object of the the specified HttpSession. |
void |
init()
Initializes the service |
boolean |
isUserLoggedIn(User user)
Determines if a given user is currently logged in. |
void |
removeSession(javax.servlet.http.HttpSession session)
Removes a session from the current list. |
void |
shutdown()
Returns to uninitialized state. |
Methods inherited from class org.apache.turbine.services.TurbineBaseService |
init, init, init |
Methods inherited from class org.apache.turbine.services.BaseService |
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker |
Methods inherited from class org.apache.turbine.services.BaseInitable |
getInit, getInitableBroker, setInit, setInitableBroker |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.turbine.services.Service |
getConfiguration, getName, getProperties, setName, setServiceBroker |
Methods inherited from interface org.apache.turbine.services.Initable |
getInit, init, setInitableBroker |
Constructor Detail |
public TurbineSessionService()
Method Detail |
public java.util.Collection getActiveSessions()
getActiveSessions
in interface SessionService
HttpSession
objects.public void addSession(javax.servlet.http.HttpSession session)
addSession
in interface SessionService
session
- Session to addpublic void removeSession(javax.servlet.http.HttpSession session)
removeSession
in interface SessionService
session
- Session to removepublic boolean isUserLoggedIn(User user)
isUserLoggedIn
in interface SessionService
user
- User to check for
public java.util.Collection getActiveUsers()
getActiveUsers
in interface SessionService
User
objects.public User getUserFromSession(javax.servlet.http.HttpSession session)
getUserFromSession
in interface SessionService
session
- The session from which to extract a user.
public javax.servlet.http.HttpSession getSession(java.lang.String sessionId)
getSession
in interface SessionService
sessionId
- The unique session identifier.
public java.util.Collection getSessionsForUser(User user)
getSessionsForUser
in interface SessionService
user
- the user
public void init()
init
in interface Initable
init
in class TurbineBaseService
public void shutdown()
shutdown
in interface Initable
shutdown
in class TurbineBaseService
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |