org.atmosphere.cpr
Class AtmosphereResourceSessionFactory

java.lang.Object
  extended by org.atmosphere.cpr.AtmosphereResourceSessionFactory
Direct Known Subclasses:
DefaultAtmosphereResourceSessionFactory

public abstract class AtmosphereResourceSessionFactory
extends Object

Factory for AtmosphereResourceSession instances

Author:
uklance (https://github.com/uklance)

Constructor Summary
AtmosphereResourceSessionFactory()
           
 
Method Summary
static AtmosphereResourceSessionFactory getDefault()
          Return the default AtmosphereResourceSessionFactory
 AtmosphereResourceSession getSession(AtmosphereResource resource)
          Returns the current session associated with the AtmosphereResource, or creates one if it does not yet exist.
abstract  AtmosphereResourceSession getSession(AtmosphereResource resource, boolean create)
          Returns the current session associated with the AtmosphereResource or, if there is no current session and create is true, returns a new session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AtmosphereResourceSessionFactory

public AtmosphereResourceSessionFactory()
Method Detail

getDefault

public static AtmosphereResourceSessionFactory getDefault()
Return the default AtmosphereResourceSessionFactory

Returns:
the default AtmosphereResourceSessionFactory

getSession

public abstract AtmosphereResourceSession getSession(AtmosphereResource resource,
                                                     boolean create)
Returns the current session associated with the AtmosphereResource or, 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.

Parameters:
resource - An AtmosphereResource
create - 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)
Returns the current session associated with the AtmosphereResource, or creates one if it does not yet exist.

Parameters:
resource - An AtmosphereResource
Returns:
the current session associated with the AtmosphereResource, or creates one if it does not yet exist.


Copyright © 2014. All Rights Reserved.