Package org.simpleframework.xml.core
Class SessionManager.Reference
- java.lang.Object
-
- org.simpleframework.xml.core.SessionManager.Reference
-
- Enclosing class:
- SessionManager
private static class SessionManager.Reference extends java.lang.Object
TheReference
object is used to store sessions and count references to them. Counting references ensures that no session is closed or disposed of until all references to it have been removed. Once references are removed the session is discarded and can no longer be acquired.
-
-
Constructor Summary
Constructors Constructor Description Reference(boolean strict)
Constructor for theReference
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
clear()
This is used to clear the references to the session.Session
get()
This is used to acquire the session and increase the count of references to the session.
-
-
-
Field Detail
-
session
private Session session
This is the session object that is maintained by this.
-
count
private int count
This is the count of the number of references to this.
-
-
Method Detail
-
get
public Session get()
This is used to acquire the session and increase the count of references to the session. When the references are all cleared then the reference counter can no longer be increased and the reference should be discarded.- Returns:
- this returns the session for this reference
-
clear
public int clear()
This is used to clear the references to the session. A reference is cleared when it is closed from the manager. The reference is disposed of when this returns zero or a negative number indicating all references are gone.- Returns:
- this returns the number of references this has
-
-