Package org.atmosphere.cpr
Class DefaultAtmosphereResourceSessionFactory
java.lang.Object
org.atmosphere.cpr.DefaultAtmosphereResourceSessionFactory
- All Implemented Interfaces:
AtmosphereResourceSessionFactory
public class DefaultAtmosphereResourceSessionFactory
extends Object
implements AtmosphereResourceSessionFactory
- Author:
- uklance (https://github.com/uklance)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()protected AtmosphereResourceEventListenerUsed in testinggetSession(AtmosphereResource resource) Returns the current session associated with theAtmosphereResource, or creates one if it does not yet exist.getSession(AtmosphereResource r, boolean create) Returns the current session associated with theAtmosphereResourceor, if there is no current session and create is true, returns a new session.
-
Constructor Details
-
DefaultAtmosphereResourceSessionFactory
public DefaultAtmosphereResourceSessionFactory()
-
-
Method Details
-
getSession
Description copied from interface:AtmosphereResourceSessionFactoryReturns the current session associated with theAtmosphereResourceor, if there is no current session and create is true, returns a new session. If create is false and the request has no valid HttpSession, this method returns null.- Specified by:
getSessionin interfaceAtmosphereResourceSessionFactory- Parameters:
r- AnAtmosphereResourcecreate- true to create a new session if necessary; false to return null if there's no current session- Returns:
- the session associated with this request or null if create is false and the resource has no valid session
-
getSession
Description copied from interface:AtmosphereResourceSessionFactoryReturns the current session associated with theAtmosphereResource, or creates one if it does not yet exist.- Specified by:
getSessionin interfaceAtmosphereResourceSessionFactory- Parameters:
resource- AnAtmosphereResource- Returns:
- the current session associated with the
AtmosphereResource, or creates one if it does not yet exist.
-
destroy
public void destroy()- Specified by:
destroyin interfaceAtmosphereResourceSessionFactory
-
getDisconnectListener
Used in testing
-