Package org.atmosphere.cpr
Class DefaultAtmosphereResourceSessionFactory
- java.lang.Object
-
- org.atmosphere.cpr.DefaultAtmosphereResourceSessionFactory
-
- All Implemented Interfaces:
AtmosphereResourceSessionFactory
public class DefaultAtmosphereResourceSessionFactory extends java.lang.Object implements AtmosphereResourceSessionFactory
- Author:
- uklance (https://github.com/uklance)
-
-
Constructor Summary
Constructors Constructor Description DefaultAtmosphereResourceSessionFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()protected AtmosphereResourceEventListenergetDisconnectListener()Used in testingAtmosphereResourceSessiongetSession(AtmosphereResource resource)Returns the current session associated with theAtmosphereResource, or creates one if it does not yet exist.AtmosphereResourceSessiongetSession(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.
-
-
-
Method Detail
-
getSession
public AtmosphereResourceSession getSession(AtmosphereResource r, boolean create)
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
public AtmosphereResourceSession getSession(AtmosphereResource resource)
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
protected AtmosphereResourceEventListener getDisconnectListener()
Used in testing
-
-