Java Doc for SessionManager.java in  » EJB-Server-resin-3.1.5 » resin » com » caucho » server » session » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » EJB Server resin 3.1.5 » resin » com.caucho.server.session 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.caucho.server.session.SessionManager

SessionManager
final public class SessionManager implements ObjectManager,AlarmListener(Code)
Manages sessions in a web-app.

Inner Class :static class DistributedObjectInputStream extends ObjectInputStream

Field Summary
final protected static  L10NL
    
final protected static  Loggerlog
    

Constructor Summary
public  SessionManager(WebApp app)
    

Method Summary
public  voidaddActivationListener(HttpSessionActivationListener listener)
     Adds a new HttpSessionActivationListener.
public  voidaddAttributeListener(HttpSessionAttributeListener listener)
     Adds a new HttpSessionAttributeListener.
public  voidaddListener(HttpSessionListener listener)
     Adds a new HttpSessionListener.
 voidaddSession(SessionImpl session)
     Adds a session from the cache.
public  voidclose()
     Cleans up the sessions when the WebApp shuts down gracefully.
public  booleancontainsSession(String id)
     Returns true if the session exists in this manager.
public  StoreManagercreateFileStore()
     Sets the file store.
public  StoreManagercreateJdbcStore()
     Sets the jdbc store.
public  SessionImplcreateSession(String oldId, long now, HttpServletRequest request, boolean fromCookie)
     Create a new session.
Parameters:
  oldId - the id passed to the request.
public  StringcreateSessionId(HttpServletRequest request)
     Creates a pseudo-random session id.
public  StringcreateSessionId(HttpServletRequest request, boolean create)
     Creates a pseudo-random session id.
public  StringcreateSessionIdImpl(HttpServletRequest request)
    
public static  intdecode(int code)
    
public  booleanenableSessionCookies()
     Returns true if sessions use the cookie header.
public  booleanenableSessionUrls()
     Returns true if sessions can use the session rewriting.
 ArrayList<HttpSessionActivationListener>getActivationListeners()
     Returns the activation listeners.
public  intgetActiveSessionCount()
     Returns the current number of active sessions.
public  SessionManagerMXBeangetAdmin()
     Returns the admin.
public  StringgetAlternateSessionPrefix()
     Returns the alternate session prefix, before the URL for wap.
 booleangetAlwaysLoadSession()
     True if sessions should always be loadd.
 booleangetAlwaysSaveSession()
     True if sessions should always be saved.
 ArrayList<HttpSessionAttributeListener>getAttributeListeners()
     Gets the HttpSessionAttributeListener.
 ServletAuthenticatorgetAuthenticator()
    
protected  ClustergetCluster()
     Gets the cluster.
public  StringgetCookieDomain()
     Returns the default session cookie domain.
public  longgetCookieLength()
     Returns the cookie length.
public  longgetCookieMaxAge()
     Returns the max-age of the session cookie.
public  StringgetCookieName()
     Returns the default cookie name.
public  StringgetCookiePort()
     Gets the cookie ports.
public  booleangetCookieSecure()
     Returns the secure of the session cookie.
public  intgetCookieVersion()
     Returns the cookie version.
public  LoggergetDebug()
    
public  StringgetDistributionId()
    
 booleangetIgnoreSerializationErrors()
     True if serialization errors should just fail silently.
 ArrayList<HttpSessionListener>getListeners()
     Adds a new HttpSessionListener.
public  longgetMaxIdleTime()
     Returns the idle time.
public  intgetReuseSessionId()
     True if the server should reuse the current session id if the session doesn't exist.
public  StringgetSSLCookieName()
     Returns the SSL cookie name.
public  StringgetSaveMode()
     Returns the string value of the save-mode.
 ClusterServergetServer(int index)
     Returns the owning server.
public  SessionImplgetSession(String key, long now, boolean create, boolean fromCookie)
     Returns a session from the session store, returning null if there's no cached session.
public  intgetSessionActiveCount()
     Returns the active sessions.
public  longgetSessionCreateCount()
     Returns the created sessions.
public  longgetSessionInvalidateCount()
     Returns the invalidate sessions.
public  intgetSessionMax()
     Returns the maximum number of sessions.
public  StringgetSessionPrefix()
     Returns the session prefix, ie..
public  StoregetSessionStore()
     Returns the session store.
public  longgetSessionTimeout()
     Returns the default session timeout in milliseconds.
public  longgetSessionTimeoutCount()
     Returns the timeout sessions.
public  intgetSrunIndex()
     Returns the index of this JVM in the ring.
public  intgetSrunLength()
    
 WebAppgetWebApp()
    
public  voidhandleAlarm(Alarm alarm)
    
public  voidinit()
    
public  booleanisClosed()
     Returns true if the sessions are closed.
public  booleanisCookieAppendServerIndex()
     Sets module session id generation.
public  booleanisCookieHttpOnly()
     Returns the http-only of the session cookie.
public  booleanisEmpty(Object obj)
     Checks if the session is empty.
public  booleanisHessianSerialization()
     Returns true for Hessian serialization.
public  booleanisInSessionGroup(String id)
    
public  booleanisInvalidateAfterListener()
     True if the session should be invalidated after the listener.
public  booleanisSaveAfterRequest()
     True if sessions should be saved after the request.
public  booleanisSaveBeforeFlush()
     True if sessions should be saved before each flush.
public  booleanisSaveBeforeHeaders()
     True if sessions should be saved before the HTTP headers.
public  booleanisSaveOnShutdown()
     True if sessions should be saved on shutdown.
public  booleanisSaveOnlyOnShutdown()
     True if sessions should only be saved on shutdown.
public  voidload(InputStream is, Object obj)
     Loads the session.
public  voidnotifyRemove(String id)
     Notification from the cluster.
public  voidnotifyUpdate(String id)
     Notification from the cluster.
 voidremoveSession(SessionImpl session)
     Removes a session from the cache.
public  booleanreuseSessionId(boolean fromCookie)
     True if the server should reuse the current session id if the session doesn't exist.
public  voidsetAlwaysLoadSession(boolean load)
     True if sessions should always be loadd.
public  voidsetAlwaysSaveSession(boolean save)
     True if sessions should always be saved.
public  voidsetClusterStore(boolean isEnable)
     Sets the cluster store.
public  voidsetCookieAppendServerIndex(boolean isAppend)
     Sets module session id generation.
public  voidsetCookieDomain(String domain)
     Sets the default session cookie domain.
public  voidsetCookieHttpOnly(boolean httpOnly)
     Sets the http-only of the session cookie.
public  voidsetCookieLength(int cookieLength)
    
public  voidsetCookieMaxAge(Period maxAge)
     Sets the max-age of the session cookie.
public  voidsetCookieModuloCluster(boolean isModulo)
     Sets module session id generation.
public  voidsetCookiePort(String port)
     Sets the cookie ports.
public  voidsetCookieSecure(boolean secure)
     Sets the secure of the session cookie.
public  voidsetCookieVersion(int cookieVersion)
     Sets the cookie version.
public  voidsetDistributionId(String distributionId)
    
public  voidsetEnableCookies(boolean enableCookies)
     Returns true if sessions use the cookie header.
public  voidsetEnableUrlRewriting(boolean enableUrls)
     Returns true if sessions can use the session rewriting.
public  voidsetIgnoreSerializationErrors(boolean ignore)
     True if serialization errors should just fail silently.
public  voidsetInvalidateAfterListener(boolean inv)
     True if the session should be invalidated after the listener.
public  voidsetPersistentPath(Path path)
     Returns the session factory.
public  voidsetPersistentStore(JndiBuilder store)
     Sets the persistent store.
public  voidsetReuseSessionId(String reuse)
     True if the server should reuse the current session id if the session doesn't exist.
public  voidsetSaveMode(String mode)
    
public  voidsetSaveOnShutdown(boolean save)
     True if sessions should only be saved on shutdown.
public  voidsetSaveOnlyOnShutdown(boolean save)
     True if sessions should only be saved on shutdown.
public  voidsetSerializationType(String type)
     Sets the serialization type.
public  voidsetSessionMax(int max)
     Returns the maximum number of sessions.
public  voidsetSessionTimeout(long timeout)
    
public  voidsetTcpStore(boolean isEnable)
     Sets the tcp store.
public  voidsetUsePersistentStore(boolean enable)
     Sets the cluster store.
public  voidstart()
    
public  voidstore(OutputStream os, Object obj)
     Saves the session.
public  StringtoString()
    

Field Detail
L
final protected static L10N L(Code)



log
final protected static Logger log(Code)




Constructor Detail
SessionManager
public SessionManager(WebApp app) throws Exception(Code)
Creates and initializes a new session manager
Parameters:
  app - the web-app webApp
Parameters:
  registry - the web-app configuration node




Method Detail
addActivationListener
public void addActivationListener(HttpSessionActivationListener listener)(Code)
Adds a new HttpSessionActivationListener.



addAttributeListener
public void addAttributeListener(HttpSessionAttributeListener listener)(Code)
Adds a new HttpSessionAttributeListener.



addListener
public void addListener(HttpSessionListener listener)(Code)
Adds a new HttpSessionListener.



addSession
void addSession(SessionImpl session)(Code)
Adds a session from the cache.



close
public void close()(Code)
Cleans up the sessions when the WebApp shuts down gracefully.



containsSession
public boolean containsSession(String id)(Code)
Returns true if the session exists in this manager.



createFileStore
public StoreManager createFileStore() throws ConfigException(Code)
Sets the file store.



createJdbcStore
public StoreManager createJdbcStore() throws ConfigException(Code)
Sets the jdbc store.



createSession
public SessionImpl createSession(String oldId, long now, HttpServletRequest request, boolean fromCookie)(Code)
Create a new session.
Parameters:
  oldId - the id passed to the request. Reuse if possible.
Parameters:
  now - the current date
Parameters:
  sessionGroup - the srun index for this machine



createSessionId
public String createSessionId(HttpServletRequest request)(Code)
Creates a pseudo-random session id. If there's an old id and the group matches, then use it because different webApps on the same matchine should use the same cookie.
Parameters:
  sessionGroup - possibly assigned by the web server



createSessionId
public String createSessionId(HttpServletRequest request, boolean create)(Code)
Creates a pseudo-random session id. If there's an old id and the group matches, then use it because different webApps on the same machine should use the same cookie.
Parameters:
  sessionGroup - possibly assigned by the web server



createSessionIdImpl
public String createSessionIdImpl(HttpServletRequest request)(Code)



decode
public static int decode(int code)(Code)



enableSessionCookies
public boolean enableSessionCookies()(Code)
Returns true if sessions use the cookie header.



enableSessionUrls
public boolean enableSessionUrls()(Code)
Returns true if sessions can use the session rewriting.



getActivationListeners
ArrayList<HttpSessionActivationListener> getActivationListeners()(Code)
Returns the activation listeners.



getActiveSessionCount
public int getActiveSessionCount()(Code)
Returns the current number of active sessions.



getAdmin
public SessionManagerMXBean getAdmin()(Code)
Returns the admin.



getAlternateSessionPrefix
public String getAlternateSessionPrefix()(Code)
Returns the alternate session prefix, before the URL for wap.



getAlwaysLoadSession
boolean getAlwaysLoadSession()(Code)
True if sessions should always be loadd.



getAlwaysSaveSession
boolean getAlwaysSaveSession()(Code)
True if sessions should always be saved.



getAttributeListeners
ArrayList<HttpSessionAttributeListener> getAttributeListeners()(Code)
Gets the HttpSessionAttributeListener.



getAuthenticator
ServletAuthenticator getAuthenticator()(Code)
Returns the SessionManager's authenticator



getCluster
protected Cluster getCluster()(Code)
Gets the cluster.



getCookieDomain
public String getCookieDomain()(Code)
Returns the default session cookie domain.



getCookieLength
public long getCookieLength()(Code)
Returns the cookie length.



getCookieMaxAge
public long getCookieMaxAge()(Code)
Returns the max-age of the session cookie.



getCookieName
public String getCookieName()(Code)
Returns the default cookie name.



getCookiePort
public String getCookiePort()(Code)
Gets the cookie ports.



getCookieSecure
public boolean getCookieSecure()(Code)
Returns the secure of the session cookie.



getCookieVersion
public int getCookieVersion()(Code)
Returns the cookie version.



getDebug
public Logger getDebug()(Code)
Returns the debug log



getDistributionId
public String getDistributionId()(Code)



getIgnoreSerializationErrors
boolean getIgnoreSerializationErrors()(Code)
True if serialization errors should just fail silently.



getListeners
ArrayList<HttpSessionListener> getListeners()(Code)
Adds a new HttpSessionListener.



getMaxIdleTime
public long getMaxIdleTime()(Code)
Returns the idle time.



getReuseSessionId
public int getReuseSessionId()(Code)
True if the server should reuse the current session id if the session doesn't exist.



getSSLCookieName
public String getSSLCookieName()(Code)
Returns the SSL cookie name.



getSaveMode
public String getSaveMode()(Code)
Returns the string value of the save-mode.



getServer
ClusterServer getServer(int index)(Code)
Returns the owning server.



getSession
public SessionImpl getSession(String key, long now, boolean create, boolean fromCookie)(Code)
Returns a session from the session store, returning null if there's no cached session.
Parameters:
  key - the session id
Parameters:
  now - the time in milliseconds the cached session.



getSessionActiveCount
public int getSessionActiveCount()(Code)
Returns the active sessions.



getSessionCreateCount
public long getSessionCreateCount()(Code)
Returns the created sessions.



getSessionInvalidateCount
public long getSessionInvalidateCount()(Code)
Returns the invalidate sessions.



getSessionMax
public int getSessionMax()(Code)
Returns the maximum number of sessions.



getSessionPrefix
public String getSessionPrefix()(Code)
Returns the session prefix, ie.. ";jsessionid=".



getSessionStore
public Store getSessionStore()(Code)
Returns the session store.



getSessionTimeout
public long getSessionTimeout()(Code)
Returns the default session timeout in milliseconds.



getSessionTimeoutCount
public long getSessionTimeoutCount()(Code)
Returns the timeout sessions.



getSrunIndex
public int getSrunIndex()(Code)
Returns the index of this JVM in the ring.



getSrunLength
public int getSrunLength()(Code)
Returns the number of sruns in the cluster



getWebApp
WebApp getWebApp()(Code)
Returns the SessionManager's webApp



handleAlarm
public void handleAlarm(Alarm alarm)(Code)
Timeout for reaping old sessions number of live sessions for stats



init
public void init()(Code)



isClosed
public boolean isClosed()(Code)
Returns true if the sessions are closed.



isCookieAppendServerIndex
public boolean isCookieAppendServerIndex()(Code)
Sets module session id generation.



isCookieHttpOnly
public boolean isCookieHttpOnly()(Code)
Returns the http-only of the session cookie.



isEmpty
public boolean isEmpty(Object obj)(Code)
Checks if the session is empty.



isHessianSerialization
public boolean isHessianSerialization()(Code)
Returns true for Hessian serialization.



isInSessionGroup
public boolean isInSessionGroup(String id)(Code)



isInvalidateAfterListener
public boolean isInvalidateAfterListener()(Code)
True if the session should be invalidated after the listener.



isSaveAfterRequest
public boolean isSaveAfterRequest()(Code)
True if sessions should be saved after the request.



isSaveBeforeFlush
public boolean isSaveBeforeFlush()(Code)
True if sessions should be saved before each flush.



isSaveBeforeHeaders
public boolean isSaveBeforeHeaders()(Code)
True if sessions should be saved before the HTTP headers.



isSaveOnShutdown
public boolean isSaveOnShutdown()(Code)
True if sessions should be saved on shutdown.



isSaveOnlyOnShutdown
public boolean isSaveOnlyOnShutdown()(Code)
True if sessions should only be saved on shutdown.



load
public void load(InputStream is, Object obj) throws IOException(Code)
Loads the session.
Parameters:
  in - the input stream containing the serialized session
Parameters:
  obj - the session object to be deserialized



notifyRemove
public void notifyRemove(String id)(Code)
Notification from the cluster.



notifyUpdate
public void notifyUpdate(String id)(Code)
Notification from the cluster.



removeSession
void removeSession(SessionImpl session)(Code)
Removes a session from the cache.



reuseSessionId
public boolean reuseSessionId(boolean fromCookie)(Code)
True if the server should reuse the current session id if the session doesn't exist.



setAlwaysLoadSession
public void setAlwaysLoadSession(boolean load)(Code)
True if sessions should always be loadd.



setAlwaysSaveSession
public void setAlwaysSaveSession(boolean save)(Code)
True if sessions should always be saved.



setClusterStore
public void setClusterStore(boolean isEnable) throws Exception(Code)
Sets the cluster store.



setCookieAppendServerIndex
public void setCookieAppendServerIndex(boolean isAppend)(Code)
Sets module session id generation.



setCookieDomain
public void setCookieDomain(String domain)(Code)
Sets the default session cookie domain.



setCookieHttpOnly
public void setCookieHttpOnly(boolean httpOnly)(Code)
Sets the http-only of the session cookie.



setCookieLength
public void setCookieLength(int cookieLength)(Code)
Sets the cookie length



setCookieMaxAge
public void setCookieMaxAge(Period maxAge)(Code)
Sets the max-age of the session cookie.



setCookieModuloCluster
public void setCookieModuloCluster(boolean isModulo)(Code)
Sets module session id generation.



setCookiePort
public void setCookiePort(String port)(Code)
Sets the cookie ports.



setCookieSecure
public void setCookieSecure(boolean secure)(Code)
Sets the secure of the session cookie.



setCookieVersion
public void setCookieVersion(int cookieVersion)(Code)
Sets the cookie version.



setDistributionId
public void setDistributionId(String distributionId)(Code)



setEnableCookies
public void setEnableCookies(boolean enableCookies)(Code)
Returns true if sessions use the cookie header.



setEnableUrlRewriting
public void setEnableUrlRewriting(boolean enableUrls)(Code)
Returns true if sessions can use the session rewriting.



setIgnoreSerializationErrors
public void setIgnoreSerializationErrors(boolean ignore)(Code)
True if serialization errors should just fail silently.



setInvalidateAfterListener
public void setInvalidateAfterListener(boolean inv)(Code)
True if the session should be invalidated after the listener.



setPersistentPath
public void setPersistentPath(Path path)(Code)
Returns the session factory.



setPersistentStore
public void setPersistentStore(JndiBuilder store) throws javax.naming.NamingException, ConfigException(Code)
Sets the persistent store.



setReuseSessionId
public void setReuseSessionId(String reuse) throws ConfigException(Code)
True if the server should reuse the current session id if the session doesn't exist.



setSaveMode
public void setSaveMode(String mode) throws ConfigException(Code)
Sets the save-mode: before-flush, before-headers, after-request, on-shutdown



setSaveOnShutdown
public void setSaveOnShutdown(boolean save)(Code)
True if sessions should only be saved on shutdown.



setSaveOnlyOnShutdown
public void setSaveOnlyOnShutdown(boolean save)(Code)
True if sessions should only be saved on shutdown.



setSerializationType
public void setSerializationType(String type)(Code)
Sets the serialization type.



setSessionMax
public void setSessionMax(int max)(Code)
Returns the maximum number of sessions.



setSessionTimeout
public void setSessionTimeout(long timeout)(Code)
Set the default session timeout in minutes



setTcpStore
public void setTcpStore(boolean isEnable) throws Exception(Code)
Sets the tcp store.



setUsePersistentStore
public void setUsePersistentStore(boolean enable) throws Exception(Code)
Sets the cluster store.



start
public void start() throws Exception(Code)



store
public void store(OutputStream os, Object obj) throws IOException(Code)
Saves the session.



toString
public String toString()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.