Java Doc for StandardSession.java in  » Sevlet-Container » apache-tomcat-6.0.14 » org » apache » catalina » 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 » Sevlet Container » apache tomcat 6.0.14 » org.apache.catalina.session 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.catalina.session.StandardSession

All known Subclasses:   org.apache.catalina.ha.session.DeltaSession,  org.apache.catalina.ha.session.ReplicatedSession,
StandardSession
public class StandardSession implements HttpSession,Session,Serializable(Code)
Standard implementation of the Session interface. This object is serializable, so that it can be stored in persistent storage or transferred to a different JVM for distributable session support.

IMPLEMENTATION NOTE: An instance of this class represents both the internal (Session) and application level (HttpSession) view of the session. However, because the class itself is not declared public, Java logic outside of the org.apache.catalina.session package cannot cast an HttpSession view of this instance back to a Session view.

IMPLEMENTATION NOTE: If you add fields to this class, you must make sure that you carry them over in the read/writeObject methods so that this class is properly serialized.
author:
   Craig R. McClanahan
author:
   Sean Legassick
author:
   Jon S. Stevens
version:
   $Revision: 505593 $ $Date: 2007-02-10 01:54:56 +0100 (sam., 10 févr. 2007) $



Field Summary
final protected static  booleanACTIVITY_CHECK
    
final protected static  StringEMPTY_ARRAY
     Type array.
final protected static  StringNOT_SERIALIZED
     The dummy attribute value serialized when a NotSerializableException is encountered in writeObject().
protected transient  AtomicIntegeraccessCount
     The access count for this session.
protected  Mapattributes
     The collection of user data attributes associated with this Session.
protected transient  StringauthType
     The authentication type used to authenticate our cached Principal, if any.
protected transient  MethodcontainerEventMethod
     The java.lang.Method for the fireContainerEvent() method of the org.apache.catalina.core.StandardContext method, if our Context implementation is of this class.
final protected static  ClasscontainerEventTypes
     The method signature for the fireContainerEvent method.
protected  longcreationTime
     The time this session was created, in milliseconds since midnight, January 1, 1970 GMT.
final protected static  String[]excludedAttributes
     Set of attribute names which are not allowed to be persisted.
protected transient  booleanexpiring
     We are currently processing a session expiration, so bypass certain IllegalStateException tests.
protected transient  StandardSessionFacadefacade
     The facade associated with this session.
protected  Stringid
     The session identifier of this Session.
final protected static  Stringinfo
     Descriptive information describing this Session implementation.
protected  booleanisNew
     Flag indicating whether this session is new or not.
protected  booleanisValid
     Flag indicating whether this session is valid or not.
protected  longlastAccessedTime
     The last accessed time for this Session.
protected transient  ArrayListlisteners
     The session event listeners for this Session.
protected transient  Managermanager
     The Manager with which this Session is associated.
protected  intmaxInactiveInterval
     The maximum time interval, in seconds, between client requests before the servlet container may invalidate this session.
protected transient  Mapnotes
     Internal notes associated with this session by Catalina components and event listeners.
protected transient  Principalprincipal
     The authenticated Principal associated with this session, if any.
protected static  HttpSessionContextsessionContext
     The HTTP session context associated with this session.
protected static  StringManagersm
     The string manager for this package.
protected transient  PropertyChangeSupportsupport
     The property change support for this component.
protected  longthisAccessedTime
     The current accessed time for this session.

Constructor Summary
public  StandardSession(Manager manager)
     Construct a new Session associated with the specified Manager.

Method Summary
public  voidaccess()
     Update the accessed time information for this session.
public  voidactivate()
     Perform internal processing required to activate this session.
public  voidaddSessionListener(SessionListener listener)
     Add a session event listener to this component.
public  voidendAccess()
     End the access.
protected  booleanexclude(String name)
     Exclude attribute that cannot be serialized.
public  voidexpire()
     Perform the internal processing required to invalidate this session, without triggering an exception if the session has already expired.
public  voidexpire(boolean notify)
     Perform the internal processing required to invalidate this session, without triggering an exception if the session has already expired.
protected  voidfireContainerEvent(Context context, String type, Object data)
     Fire container events if the Context implementation is the org.apache.catalina.core.StandardContext.
public  voidfireSessionEvent(String type, Object data)
     Notify all session event listeners that a particular event has occurred for this Session.
public  ObjectgetAttribute(String name)
     Return the object bound with the specified name in this session, or null if no object is bound with that name.
public  EnumerationgetAttributeNames()
     Return an Enumeration of String objects containing the names of the objects bound to this session.
public  StringgetAuthType()
     Return the authentication type used to authenticate our cached Principal, if any.
public  longgetCreationTime()
     Return the time when this session was created, in milliseconds since midnight, January 1, 1970 GMT.
public  StringgetId()
     Return the session identifier for this session.
public  StringgetIdInternal()
     Return the session identifier for this session.
public  StringgetInfo()
     Return descriptive information about this Session implementation and the corresponding version number, in the format <description>/<version>.
public  longgetLastAccessedTime()
     Return the last time the client sent a request associated with this session, as the number of milliseconds since midnight, January 1, 1970 GMT.
public  longgetLastAccessedTimeInternal()
    
public  ManagergetManager()
     Return the Manager within which this Session is valid.
public  intgetMaxInactiveInterval()
     Return the maximum time interval, in seconds, between client requests before the servlet container will invalidate the session.
public  ObjectgetNote(String name)
     Return the object bound with the specified name to the internal notes for this session, or null if no such binding exists.
public  IteratorgetNoteNames()
     Return an Iterator containing the String names of all notes bindings that exist for this session.
public  PrincipalgetPrincipal()
     Return the authenticated Principal that is associated with this Session. This provides an Authenticator with a means to cache a previously authenticated Principal, and avoid potentially expensive Realm.authenticate() calls on every request.
public  ServletContextgetServletContext()
     Return the ServletContext to which this session belongs.
public  HttpSessiongetSession()
     Return the HttpSession for which this object is the facade.
public  HttpSessionContextgetSessionContext()
     Return the session context with which this session is associated.
public  ObjectgetValue(String name)
     Return the object bound with the specified name in this session, or null if no object is bound with that name.
public  String[]getValueNames()
     Return the set of names of objects bound to this session.
public  voidinvalidate()
     Invalidates this session and unbinds any objects bound to it.
public  booleanisNew()
     Return true if the client does not yet know about the session, or if the client chooses not to join the session.
public  booleanisValid()
     Return the isValid flag for this session.
protected  booleanisValidInternal()
     Return the isValid flag for this session without any expiration check.
protected  String[]keys()
     Return the names of all currently defined session attributes as an array of Strings.
public  voidpassivate()
     Perform the internal processing required to passivate this session.
public  voidputValue(String name, Object value)
     Bind an object to this session, using the specified name.
protected  voidreadObject(ObjectInputStream stream)
     Read a serialized version of this session object from the specified object input stream.
public  voidreadObjectData(ObjectInputStream stream)
     Read a serialized version of the contents of this session object from the specified object input stream, without requiring that the StandardSession itself have been serialized.
public  voidrecycle()
     Release all object references, and initialize instance variables, in preparation for reuse of this object.
public  voidremoveAttribute(String name)
     Remove the object bound with the specified name from this session.
public  voidremoveAttribute(String name, boolean notify)
     Remove the object bound with the specified name from this session.
protected  voidremoveAttributeInternal(String name, boolean notify)
     Remove the object bound with the specified name from this session.
public  voidremoveNote(String name)
     Remove any object bound to the specified name in the internal notes for this session.
public  voidremoveSessionListener(SessionListener listener)
     Remove a session event listener from this component.
public  voidremoveValue(String name)
     Remove the object bound with the specified name from this session.
public  voidsetAttribute(String name, Object value)
     Bind an object to this session, using the specified name.
public  voidsetAttribute(String name, Object value, boolean notify)
     Bind an object to this session, using the specified name.
public  voidsetAuthType(String authType)
     Set the authentication type used to authenticate our cached Principal, if any.
public  voidsetCreationTime(long time)
     Set the creation time for this session.
public  voidsetId(String id)
     Set the session identifier for this session.
public  voidsetManager(Manager manager)
     Set the Manager within which this Session is valid.
public  voidsetMaxInactiveInterval(int interval)
     Set the maximum time interval, in seconds, between client requests before the servlet container will invalidate the session.
public  voidsetNew(boolean isNew)
     Set the isNew flag for this session.
public  voidsetNote(String name, Object value)
     Bind an object to a specified name in the internal notes associated with this session, replacing any existing binding for this name.
public  voidsetPrincipal(Principal principal)
     Set the authenticated Principal that is associated with this Session.
public  voidsetValid(boolean isValid)
     Set the isValid flag for this session.
public  voidtellNew()
     Inform the listeners about the new session.
public  StringtoString()
     Return a string representation of this object.
protected  voidwriteObject(ObjectOutputStream stream)
     Write a serialized version of this session object to the specified object output stream.

IMPLEMENTATION NOTE: The owning Manager will not be stored in the serialized representation of this Session.

public  voidwriteObjectData(ObjectOutputStream stream)
     Write a serialized version of the contents of this session object to the specified object output stream, without requiring that the StandardSession itself have been serialized.

Field Detail
ACTIVITY_CHECK
final protected static boolean ACTIVITY_CHECK(Code)



EMPTY_ARRAY
final protected static String EMPTY_ARRAY(Code)
Type array.



NOT_SERIALIZED
final protected static String NOT_SERIALIZED(Code)
The dummy attribute value serialized when a NotSerializableException is encountered in writeObject().



accessCount
protected transient AtomicInteger accessCount(Code)
The access count for this session.



attributes
protected Map attributes(Code)
The collection of user data attributes associated with this Session.



authType
protected transient String authType(Code)
The authentication type used to authenticate our cached Principal, if any. NOTE: This value is not included in the serialized version of this object.



containerEventMethod
protected transient Method containerEventMethod(Code)
The java.lang.Method for the fireContainerEvent() method of the org.apache.catalina.core.StandardContext method, if our Context implementation is of this class. This value is computed dynamically the first time it is needed, or after a session reload (since it is declared transient).



containerEventTypes
final protected static Class containerEventTypes(Code)
The method signature for the fireContainerEvent method.



creationTime
protected long creationTime(Code)
The time this session was created, in milliseconds since midnight, January 1, 1970 GMT.



excludedAttributes
final protected static String[] excludedAttributes(Code)
Set of attribute names which are not allowed to be persisted.



expiring
protected transient boolean expiring(Code)
We are currently processing a session expiration, so bypass certain IllegalStateException tests. NOTE: This value is not included in the serialized version of this object.



facade
protected transient StandardSessionFacade facade(Code)
The facade associated with this session. NOTE: This value is not included in the serialized version of this object.



id
protected String id(Code)
The session identifier of this Session.



info
final protected static String info(Code)
Descriptive information describing this Session implementation.



isNew
protected boolean isNew(Code)
Flag indicating whether this session is new or not.



isValid
protected boolean isValid(Code)
Flag indicating whether this session is valid or not.



lastAccessedTime
protected long lastAccessedTime(Code)
The last accessed time for this Session.



listeners
protected transient ArrayList listeners(Code)
The session event listeners for this Session.



manager
protected transient Manager manager(Code)
The Manager with which this Session is associated.



maxInactiveInterval
protected int maxInactiveInterval(Code)
The maximum time interval, in seconds, between client requests before the servlet container may invalidate this session. A negative time indicates that the session should never time out.



notes
protected transient Map notes(Code)
Internal notes associated with this session by Catalina components and event listeners. IMPLEMENTATION NOTE: This object is not saved and restored across session serializations!



principal
protected transient Principal principal(Code)
The authenticated Principal associated with this session, if any. IMPLEMENTATION NOTE: This object is not saved and restored across session serializations!



sessionContext
protected static HttpSessionContext sessionContext(Code)
The HTTP session context associated with this session.



sm
protected static StringManager sm(Code)
The string manager for this package.



support
protected transient PropertyChangeSupport support(Code)
The property change support for this component. NOTE: This value is not included in the serialized version of this object.



thisAccessedTime
protected long thisAccessedTime(Code)
The current accessed time for this session.




Constructor Detail
StandardSession
public StandardSession(Manager manager)(Code)
Construct a new Session associated with the specified Manager.
Parameters:
  manager - The manager with which this Session is associated




Method Detail
access
public void access()(Code)
Update the accessed time information for this session. This method should be called by the context when a request comes in for a particular session, even if the application does not reference it.



activate
public void activate()(Code)
Perform internal processing required to activate this session.



addSessionListener
public void addSessionListener(SessionListener listener)(Code)
Add a session event listener to this component.



endAccess
public void endAccess()(Code)
End the access.



exclude
protected boolean exclude(String name)(Code)
Exclude attribute that cannot be serialized.
Parameters:
  name - the attribute's name



expire
public void expire()(Code)
Perform the internal processing required to invalidate this session, without triggering an exception if the session has already expired.



expire
public void expire(boolean notify)(Code)
Perform the internal processing required to invalidate this session, without triggering an exception if the session has already expired.
Parameters:
  notify - Should we notify listeners about the demise ofthis session?



fireContainerEvent
protected void fireContainerEvent(Context context, String type, Object data) throws Exception(Code)
Fire container events if the Context implementation is the org.apache.catalina.core.StandardContext.
Parameters:
  context - Context for which to fire events
Parameters:
  type - Event type
Parameters:
  data - Event data
exception:
  Exception - occurred during event firing



fireSessionEvent
public void fireSessionEvent(String type, Object data)(Code)
Notify all session event listeners that a particular event has occurred for this Session. The default implementation performs this notification synchronously using the calling thread.
Parameters:
  type - Event type
Parameters:
  data - Event data



getAttribute
public Object getAttribute(String name)(Code)
Return the object bound with the specified name in this session, or null if no object is bound with that name.
Parameters:
  name - Name of the attribute to be returned
exception:
  IllegalStateException - if this method is called on aninvalidated session



getAttributeNames
public Enumeration getAttributeNames()(Code)
Return an Enumeration of String objects containing the names of the objects bound to this session.
exception:
  IllegalStateException - if this method is called on aninvalidated session



getAuthType
public String getAuthType()(Code)
Return the authentication type used to authenticate our cached Principal, if any.



getCreationTime
public long getCreationTime()(Code)
Return the time when this session was created, in milliseconds since midnight, January 1, 1970 GMT.
exception:
  IllegalStateException - if this method is called on aninvalidated session



getId
public String getId()(Code)
Return the session identifier for this session.



getIdInternal
public String getIdInternal()(Code)
Return the session identifier for this session.



getInfo
public String getInfo()(Code)
Return descriptive information about this Session implementation and the corresponding version number, in the format <description>/<version>.



getLastAccessedTime
public long getLastAccessedTime()(Code)
Return the last time the client sent a request associated with this session, as the number of milliseconds since midnight, January 1, 1970 GMT. Actions that your application takes, such as getting or setting a value associated with the session, do not affect the access time.



getLastAccessedTimeInternal
public long getLastAccessedTimeInternal()(Code)
Return the last client access time without invalidation check
See Also:    #getLastAccessedTime().



getManager
public Manager getManager()(Code)
Return the Manager within which this Session is valid.



getMaxInactiveInterval
public int getMaxInactiveInterval()(Code)
Return the maximum time interval, in seconds, between client requests before the servlet container will invalidate the session. A negative time indicates that the session should never time out.



getNote
public Object getNote(String name)(Code)
Return the object bound with the specified name to the internal notes for this session, or null if no such binding exists.
Parameters:
  name - Name of the note to be returned



getNoteNames
public Iterator getNoteNames()(Code)
Return an Iterator containing the String names of all notes bindings that exist for this session.



getPrincipal
public Principal getPrincipal()(Code)
Return the authenticated Principal that is associated with this Session. This provides an Authenticator with a means to cache a previously authenticated Principal, and avoid potentially expensive Realm.authenticate() calls on every request. If there is no current associated Principal, return null.



getServletContext
public ServletContext getServletContext()(Code)
Return the ServletContext to which this session belongs.



getSession
public HttpSession getSession()(Code)
Return the HttpSession for which this object is the facade.



getSessionContext
public HttpSessionContext getSessionContext()(Code)
Return the session context with which this session is associated.



getValue
public Object getValue(String name)(Code)
Return the object bound with the specified name in this session, or null if no object is bound with that name.
Parameters:
  name - Name of the value to be returned
exception:
  IllegalStateException - if this method is called on aninvalidated session



getValueNames
public String[] getValueNames()(Code)
Return the set of names of objects bound to this session. If there are no such objects, a zero-length array is returned.
exception:
  IllegalStateException - if this method is called on aninvalidated session



invalidate
public void invalidate()(Code)
Invalidates this session and unbinds any objects bound to it.
exception:
  IllegalStateException - if this method is called onan invalidated session



isNew
public boolean isNew()(Code)
Return true if the client does not yet know about the session, or if the client chooses not to join the session. For example, if the server used only cookie-based sessions, and the client has disabled the use of cookies, then a session would be new on each request.
exception:
  IllegalStateException - if this method is called on aninvalidated session



isValid
public boolean isValid()(Code)
Return the isValid flag for this session.



isValidInternal
protected boolean isValidInternal()(Code)
Return the isValid flag for this session without any expiration check.



keys
protected String[] keys()(Code)
Return the names of all currently defined session attributes as an array of Strings. If there are no defined attributes, a zero-length array is returned.



passivate
public void passivate()(Code)
Perform the internal processing required to passivate this session.



putValue
public void putValue(String name, Object value)(Code)
Bind an object to this session, using the specified name. If an object of the same name is already bound to this session, the object is replaced.

After this method executes, and if the object implements HttpSessionBindingListener, the container calls valueBound() on the object.
Parameters:
  name - Name to which the object is bound, cannot be null
Parameters:
  value - Object to be bound, cannot be null
exception:
  IllegalStateException - if this method is called on aninvalidated session




readObject
protected void readObject(ObjectInputStream stream) throws ClassNotFoundException, IOException(Code)
Read a serialized version of this session object from the specified object input stream.

IMPLEMENTATION NOTE: The reference to the owning Manager is not restored by this method, and must be set explicitly.
Parameters:
  stream - The input stream to read from
exception:
  ClassNotFoundException - if an unknown class is specified
exception:
  IOException - if an input/output error occurs




readObjectData
public void readObjectData(ObjectInputStream stream) throws ClassNotFoundException, IOException(Code)
Read a serialized version of the contents of this session object from the specified object input stream, without requiring that the StandardSession itself have been serialized.
Parameters:
  stream - The object input stream to read from
exception:
  ClassNotFoundException - if an unknown class is specified
exception:
  IOException - if an input/output error occurs



recycle
public void recycle()(Code)
Release all object references, and initialize instance variables, in preparation for reuse of this object.



removeAttribute
public void removeAttribute(String name)(Code)
Remove the object bound with the specified name from this session. If the session does not have an object bound with this name, this method does nothing.

After this method executes, and if the object implements HttpSessionBindingListener, the container calls valueUnbound() on the object.
Parameters:
  name - Name of the object to remove from this session.
exception:
  IllegalStateException - if this method is called on aninvalidated session




removeAttribute
public void removeAttribute(String name, boolean notify)(Code)
Remove the object bound with the specified name from this session. If the session does not have an object bound with this name, this method does nothing.

After this method executes, and if the object implements HttpSessionBindingListener, the container calls valueUnbound() on the object.
Parameters:
  name - Name of the object to remove from this session.
Parameters:
  notify - Should we notify interested listeners that thisattribute is being removed?
exception:
  IllegalStateException - if this method is called on aninvalidated session




removeAttributeInternal
protected void removeAttributeInternal(String name, boolean notify)(Code)
Remove the object bound with the specified name from this session. If the session does not have an object bound with this name, this method does nothing.

After this method executes, and if the object implements HttpSessionBindingListener, the container calls valueUnbound() on the object.
Parameters:
  name - Name of the object to remove from this session.
Parameters:
  notify - Should we notify interested listeners that thisattribute is being removed?




removeNote
public void removeNote(String name)(Code)
Remove any object bound to the specified name in the internal notes for this session.
Parameters:
  name - Name of the note to be removed



removeSessionListener
public void removeSessionListener(SessionListener listener)(Code)
Remove a session event listener from this component.



removeValue
public void removeValue(String name)(Code)
Remove the object bound with the specified name from this session. If the session does not have an object bound with this name, this method does nothing.

After this method executes, and if the object implements HttpSessionBindingListener, the container calls valueUnbound() on the object.
Parameters:
  name - Name of the object to remove from this session.
exception:
  IllegalStateException - if this method is called on aninvalidated session




setAttribute
public void setAttribute(String name, Object value)(Code)
Bind an object to this session, using the specified name. If an object of the same name is already bound to this session, the object is replaced.

After this method executes, and if the object implements HttpSessionBindingListener, the container calls valueBound() on the object.
Parameters:
  name - Name to which the object is bound, cannot be null
Parameters:
  value - Object to be bound, cannot be null
exception:
  IllegalArgumentException - if an attempt is made to add anon-serializable object in an environment marked distributable.
exception:
  IllegalStateException - if this method is called on aninvalidated session




setAttribute
public void setAttribute(String name, Object value, boolean notify)(Code)
Bind an object to this session, using the specified name. If an object of the same name is already bound to this session, the object is replaced.

After this method executes, and if the object implements HttpSessionBindingListener, the container calls valueBound() on the object.
Parameters:
  name - Name to which the object is bound, cannot be null
Parameters:
  value - Object to be bound, cannot be null
Parameters:
  notify - whether to notify session listeners
exception:
  IllegalArgumentException - if an attempt is made to add anon-serializable object in an environment marked distributable.
exception:
  IllegalStateException - if this method is called on aninvalidated session




setAuthType
public void setAuthType(String authType)(Code)
Set the authentication type used to authenticate our cached Principal, if any.
Parameters:
  authType - The new cached authentication type



setCreationTime
public void setCreationTime(long time)(Code)
Set the creation time for this session. This method is called by the Manager when an existing Session instance is reused.
Parameters:
  time - The new creation time



setId
public void setId(String id)(Code)
Set the session identifier for this session.
Parameters:
  id - The new session identifier



setManager
public void setManager(Manager manager)(Code)
Set the Manager within which this Session is valid.
Parameters:
  manager - The new Manager



setMaxInactiveInterval
public void setMaxInactiveInterval(int interval)(Code)
Set the maximum time interval, in seconds, between client requests before the servlet container will invalidate the session. A negative time indicates that the session should never time out.
Parameters:
  interval - The new maximum interval



setNew
public void setNew(boolean isNew)(Code)
Set the isNew flag for this session.
Parameters:
  isNew - The new value for the isNew flag



setNote
public void setNote(String name, Object value)(Code)
Bind an object to a specified name in the internal notes associated with this session, replacing any existing binding for this name.
Parameters:
  name - Name to which the object should be bound
Parameters:
  value - Object to be bound to the specified name



setPrincipal
public void setPrincipal(Principal principal)(Code)
Set the authenticated Principal that is associated with this Session. This provides an Authenticator with a means to cache a previously authenticated Principal, and avoid potentially expensive Realm.authenticate() calls on every request.
Parameters:
  principal - The new Principal, or null if none



setValid
public void setValid(boolean isValid)(Code)
Set the isValid flag for this session.
Parameters:
  isValid - The new value for the isValid flag



tellNew
public void tellNew()(Code)
Inform the listeners about the new session.



toString
public String toString()(Code)
Return a string representation of this object.



writeObject
protected void writeObject(ObjectOutputStream stream) throws IOException(Code)
Write a serialized version of this session object to the specified object output stream.

IMPLEMENTATION NOTE: The owning Manager will not be stored in the serialized representation of this Session. After calling readObject(), you must set the associated Manager explicitly.

IMPLEMENTATION NOTE: Any attribute that is not Serializable will be unbound from the session, with appropriate actions if it implements HttpSessionBindingListener. If you do not want any such attributes, be sure the distributable property of the associated Manager is set to true.
Parameters:
  stream - The output stream to write to
exception:
  IOException - if an input/output error occurs




writeObjectData
public void writeObjectData(ObjectOutputStream stream) throws IOException(Code)
Write a serialized version of the contents of this session object to the specified object output stream, without requiring that the StandardSession itself have been serialized.
Parameters:
  stream - The object output stream to write to
exception:
  IOException - if an input/output error occurs



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.