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.
 
Field Summary
protected static org.slf4j.Logger logger
           
protected  List<AtmosphereConfig.ShutdownHook> shutdownHooks
           
 
Constructor Summary
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.
 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.
 boolean isSupportSession()
          Is HttpSession supported.
 boolean isThrowExceptionOnCloned()
          Is cloned request throws exception.
 Map<String,Object> properties()
          Return the Map of Applications's properties.
 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.
 
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 final List<AtmosphereConfig.ShutdownHook> shutdownHooks
Constructor Detail

AtmosphereConfig

public 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 list of init params defined in web.xml or application.xml

getInitParameterNames

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

Returns:

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

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.


shutdownHook

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

Parameters:
s - a AtmosphereConfig.ShutdownHook
Returns:
this


Copyright © 2013. All Rights Reserved.