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 : If you add fields to this class, you must make sure that you carry
| 66 | * read/writeObject methods so that this class is properly serialized. |
| 67 | */ |
| 68 | public class StandardSession implements HttpSession, Session, Serializable { |
| 69 | |
| 70 | @Serial |
| 71 | private static final long serialVersionUID = 1L; |
| 72 | |
| 73 | // ----------------------------------------------------------- Constructors |
| 74 | |
| 75 | |
| 76 | /** |
| 77 | * Construct a new Session associated with the specified Manager. |
| 78 | * |
| 79 | * @param manager The manager with which this Session is associated |
| 80 | */ |
| 81 | public StandardSession(Manager manager) { |
| 82 | |
| 83 | super(); |
| 84 | this.manager = manager; |
| 85 | |
| 86 | if (manager != null) { |
| 87 | // Manager could be null in test environments |
| 88 | activityCheck = manager.getSessionActivityCheck(); |
| 89 | lastAccessAtStart = manager.getSessionLastAccessAtStart(); |
| 90 | } |
| 91 | |
| 92 | // Initialize access count |
| 93 | if (activityCheck) { |
| 94 | accessCount = new AtomicInteger(); |
| 95 | } |
| 96 | |
| 97 | } |
| 98 | |
| 99 | |
| 100 | // ----------------------------------------------------- Instance Variables |
| 101 | |
| 102 | |
| 103 | /** |
| 104 | * Type array. |
| 105 | */ |
| 106 | protected static final String[] EMPTY_ARRAY = new String[0]; |
| 107 | |
| 108 | |
| 109 | /** |
| 110 | * The collection of user data attributes associated with this Session. |
| 111 | */ |
| 112 | protected ConcurrentMap<String,Object> attributes = new ConcurrentHashMap<>(); |
| 113 | |
| 114 | |
| 115 | /** |
| 116 | * The authentication type used to authenticate our cached Principal, if any. NOTE: This value is not included in |
| 117 | * the serialized version of this object. |
| 118 | */ |
| 119 | protected transient String authType = null; |
| 120 | |
| 121 | |
| 122 | /** |
| 123 | * The time this session was created, in milliseconds since midnight, January 1, 1970 GMT. |
| 124 | */ |
| 125 | protected long creationTime = 0L; |
nothing calls this directly
no test coverage detected