org.atmosphere.cpr
Class AtmosphereConfig

java.lang.Object
  extended by org.atmosphere.cpr.AtmosphereConfig

public class AtmosphereConfig
extends Object

This class contains information about the current state of the AtmosphereFramework. You can also register a AtmosphereConfig.ShutdownHook.

Author:
Sebastien Dionne : sebastien.dionne@gmail.com, Jeanfrancois Arcand

Nested Class Summary
static interface AtmosphereConfig.ShutdownHook
          A shutdown hook that will be called when the AtmosphereFramework.destroy() method gets invoked.
static interface AtmosphereConfig.StartupHook
          A Startup hook that will be called when the AtmosphereFramework.init() method complete.
 
Field Summary
protected static org.slf4j.Logger logger
           
protected  List<AtmosphereConfig.ShutdownHook> shutdownHooks
           
protected  List<AtmosphereConfig.StartupHook> startUpHook
           
 
Constructor Summary
protected AtmosphereConfig(AtmosphereFramework framework)
           
 
Method Summary
protected  void destroy()
          Invoke AtmosphereConfig.ShutdownHooks.
 AtmosphereFramework framework()
          Return the AtmosphereFramework.
 List<AtmosphereHandlerConfig> getAtmosphereHandlerConfig()
           
 BroadcasterFactory getBroadcasterFactory()
          Return an instance of DefaultBroadcasterFactory.
 String getInitParameter(String name)
          Return the value of the init params defined in web.xml or application.xml.
 boolean getInitParameter(String key, boolean defaultValue)
          Return an init-param, or its default value.
 int getInitParameter(String key, int defaultValue)
          Return an init-param, or its default value.
 String getInitParameter(String key, String defaultValue)
          Return an init-param, or its default value.
 Enumeration<String> getInitParameterNames()
          Return all init param.
 javax.servlet.ServletConfig getServletConfig()
          Return the ServletConfig.
 javax.servlet.ServletContext getServletContext()
          Return the ServletContext.
 String getWebServerName()
          Return the current WebServer used.
 Map<String,AtmosphereFramework.AtmosphereHandlerWrapper> handlers()
          Return the list of AtmosphereFramework.AtmosphereHandlerWrappers.
protected  void initComplete()
          Invoke AtmosphereConfig.ShutdownHooks.
 boolean isSessionTimeoutRemovalAllowed()
          Allow HTTP session timeout removal when session support is active
 boolean isSupportSession()
          Is HttpSession supported.
 boolean isThrowExceptionOnCloned()
          Is cloned request throws exception.
 MetaBroadcaster metaBroadcaster()
          Return the DefaultMetaBroadcaster
 AtmosphereConfig populate(AtmosphereConfig config)
           
 Map<String,Object> properties()
          Return the Map of Applications's properties.
 AtmosphereResourceFactory resourcesFactory()
          Return the AtmosphereResourceFactory
 AtmosphereResourceSessionFactory sessionFactory()
          Return the AtmosphereResourceSessionFactory
 void setSessionTimeoutRemovalAllowed(boolean sessionTimeoutRemovalAllowed)
          Enable/Disable HttpSession timeout removal when a connection exists.
 void setSupportSession(boolean supportSession)
          Enable/Disable HttpSession.
 void setThrowExceptionOnCloned(boolean throwExceptionOnCloned)
          Enable/Disable Exception on cloned request.
 AtmosphereConfig shutdownHook(AtmosphereConfig.ShutdownHook s)
          Add a AtmosphereConfig.ShutdownHook.
 AtmosphereConfig startupHook(AtmosphereConfig.StartupHook s)
          Add a AtmosphereConfig.StartupHook.
 UUIDProvider uuidProvider()
          Return the UUIDProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.slf4j.Logger logger

shutdownHooks

protected List<AtmosphereConfig.ShutdownHook> shutdownHooks

startUpHook

protected List<AtmosphereConfig.StartupHook> startUpHook
Constructor Detail

AtmosphereConfig

protected AtmosphereConfig(AtmosphereFramework framework)
Method Detail

getAtmosphereHandlerConfig

public List<AtmosphereHandlerConfig> getAtmosphereHandlerConfig()

framework

public AtmosphereFramework framework()
Return the AtmosphereFramework.

Returns:
the AtmosphereFramework

getServletConfig

public javax.servlet.ServletConfig getServletConfig()
Return the ServletConfig.

Returns:
ServletConfig

getServletContext

public javax.servlet.ServletContext getServletContext()
Return the ServletContext.

Returns:
ServletContext

getWebServerName

public String getWebServerName()
Return the current WebServer used.

Returns:
the current WebServer used

handlers

public Map<String,AtmosphereFramework.AtmosphereHandlerWrapper> handlers()
Return the list of AtmosphereFramework.AtmosphereHandlerWrappers.

Returns:
the list of AtmosphereFramework.AtmosphereHandlerWrapper

getInitParameter

public String getInitParameter(String name)
Return the value of the init params defined in web.xml or application.xml.

Parameters:
name - the name
Returns:
the value for the init parameter if defined

getInitParameterNames

public Enumeration<String> getInitParameterNames()
Return all init param.

Returns:
the list of init params defined in web.xml or application.xml for the servlet

isSupportSession

public boolean isSupportSession()
Is HttpSession supported.

Returns:
HttpSession supported.

setSupportSession

public void setSupportSession(boolean supportSession)
Enable/Disable HttpSession.

Parameters:
supportSession - true to enable, false to disable

isSessionTimeoutRemovalAllowed

public boolean isSessionTimeoutRemovalAllowed()
Allow HTTP session timeout removal when session support is active

Returns:
HTTP session timeout removal allowed.

setSessionTimeoutRemovalAllowed

public void setSessionTimeoutRemovalAllowed(boolean sessionTimeoutRemovalAllowed)
Enable/Disable HttpSession timeout removal when a connection exists.

Parameters:
sessionTimeoutRemovalAllowed - true to enable, false to disable

isThrowExceptionOnCloned

public boolean isThrowExceptionOnCloned()
Is cloned request throws exception.

Returns:
Cloned Request's exception supported.

setThrowExceptionOnCloned

public void setThrowExceptionOnCloned(boolean throwExceptionOnCloned)
Enable/Disable Exception on cloned request.

Parameters:
throwExceptionOnCloned -

getBroadcasterFactory

public BroadcasterFactory getBroadcasterFactory()
Return an instance of DefaultBroadcasterFactory.

Returns:
an instance of DefaultBroadcasterFactory

properties

public Map<String,Object> properties()
Return the Map of Applications's properties.

Returns:
the Map of Applications's properties

destroy

protected void destroy()
Invoke AtmosphereConfig.ShutdownHooks.


initComplete

protected void initComplete()
Invoke AtmosphereConfig.ShutdownHooks.


shutdownHook

public AtmosphereConfig shutdownHook(AtmosphereConfig.ShutdownHook s)
Add a AtmosphereConfig.ShutdownHook.

Parameters:
s - a AtmosphereConfig.ShutdownHook
Returns:
this

startupHook

public AtmosphereConfig startupHook(AtmosphereConfig.StartupHook s)
Add a AtmosphereConfig.StartupHook.

Parameters:
s - a AtmosphereConfig.StartupHook
Returns:
this

getInitParameter

public String getInitParameter(String key,
                               String defaultValue)
Return an init-param, or its default value.

Parameters:
key -
defaultValue -
Returns:
an init-param, or its default value.

getInitParameter

public boolean getInitParameter(String key,
                                boolean defaultValue)
Return an init-param, or its default value.

Parameters:
key -
defaultValue -
Returns:
an init-param, or its default value.

getInitParameter

public int getInitParameter(String key,
                            int defaultValue)
Return an init-param, or its default value.

Parameters:
key -
defaultValue -
Returns:
an init-param, or its default value.

resourcesFactory

public AtmosphereResourceFactory resourcesFactory()
Return the AtmosphereResourceFactory

Returns:
the AtmosphereResourceFactory

metaBroadcaster

public MetaBroadcaster metaBroadcaster()
Return the DefaultMetaBroadcaster

Returns:
the MetaBroadcaster

sessionFactory

public AtmosphereResourceSessionFactory sessionFactory()
Return the AtmosphereResourceSessionFactory

Returns:
the AtmosphereResourceSessionFactory

uuidProvider

public UUIDProvider uuidProvider()
Return the UUIDProvider

Returns:
UUIDProvider

populate

public AtmosphereConfig populate(AtmosphereConfig config)


Copyright © 2015. All Rights Reserved.