Package org.atmosphere.cpr
Class AtmosphereConfig
java.lang.Object
org.atmosphere.cpr.AtmosphereConfig
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
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA shutdown hook that will be called when theAtmosphereFramework.destroy()method gets invoked.static interfaceA Startup hook that will be called when theAtmosphereFramework.init()method complete. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.slf4j.Loggerprotected List<AtmosphereConfig.ShutdownHook> protected List<AtmosphereConfig.StartupHook> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddestroy()InvokeAtmosphereConfig.ShutdownHooks.Return theAtmosphereFramework.Return an instance ofDefaultBroadcasterFactory.getInitParameter(String name) Return the value of the init params defined in web.xml or application.xml.booleangetInitParameter(String key, boolean defaultValue) Return an init-param, or its default value.intgetInitParameter(String key, int defaultValue) Return an init-param, or its default value.getInitParameter(String key, String defaultValue) Return an init-param, or its default value.Return all init param.javax.servlet.ServletConfigReturn theServletConfig.javax.servlet.ServletContextReturn theServletContext.Return the current WebServer used.handlers()Return the list ofAtmosphereFramework.AtmosphereHandlerWrappers.protected voidInvokeAtmosphereConfig.ShutdownHooks.booleanAllow HTTP session timeout removal when session support is activebooleanIsHttpSessionsupported.booleanIs cloned request throws exception.Return theDefaultMetaBroadcasterpopulate(AtmosphereConfig config) Return theMapof Applications's properties.Return theAtmosphereResourceFactoryReturn theAtmosphereResourceSessionFactoryvoidsetSessionTimeoutRemovalAllowed(boolean sessionTimeoutRemovalAllowed) Enable/DisableHttpSessiontimeout removal when a connection exists.voidsetSupportSession(boolean supportSession) Enable/DisableHttpSession.voidsetThrowExceptionOnCloned(boolean throwExceptionOnCloned) Enable/Disable Exception on cloned request.Add aAtmosphereConfig.StartupHook.Return theUUIDProviderReturn theWebSocketFactory
-
Field Details
-
logger
protected static final org.slf4j.Logger logger -
shutdownHooks
-
startUpHook
-
-
Constructor Details
-
AtmosphereConfig
-
-
Method Details
-
getAtmosphereHandlerConfig
-
framework
Return theAtmosphereFramework.- Returns:
- the
AtmosphereFramework
-
getServletConfig
public javax.servlet.ServletConfig getServletConfig()Return theServletConfig.- Returns:
ServletConfig
-
getServletContext
public javax.servlet.ServletContext getServletContext()Return theServletContext.- Returns:
ServletContext
-
getWebServerName
Return the current WebServer used.- Returns:
- the current WebServer used
-
handlers
Return the list ofAtmosphereFramework.AtmosphereHandlerWrappers.- Returns:
- the list of
AtmosphereFramework.AtmosphereHandlerWrapper
-
getInitParameter
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
Return all init param.- Returns:
- the list of init params defined in web.xml or application.xml for the servlet
-
isSupportSession
public boolean isSupportSession()IsHttpSessionsupported.- Returns:
HttpSessionsupported.
-
setSupportSession
public void setSupportSession(boolean supportSession) Enable/DisableHttpSession.- 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/DisableHttpSessiontimeout 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
Return an instance ofDefaultBroadcasterFactory.- Returns:
- an instance of
DefaultBroadcasterFactory
-
properties
Return theMapof Applications's properties.- Returns:
- the
Mapof Applications's properties
-
destroy
protected void destroy()InvokeAtmosphereConfig.ShutdownHooks. -
initComplete
protected void initComplete()InvokeAtmosphereConfig.ShutdownHooks. -
shutdownHook
- Parameters:
s- aAtmosphereConfig.ShutdownHook- Returns:
- this
-
startupHook
Add aAtmosphereConfig.StartupHook. If theAtmosphereFramework.isInitreturn true, the StartupHook will be executed immediately.- Parameters:
s- aAtmosphereConfig.StartupHook- Returns:
- this
-
getInitParameter
Return an init-param, or its default value.- Parameters:
key-defaultValue-- Returns:
- an init-param, or its default value.
-
getInitParameter
Return an init-param, or its default value.- Parameters:
key-defaultValue-- Returns:
- an init-param, or its default value.
-
getInitParameter
Return an init-param, or its default value.- Parameters:
key-defaultValue-- Returns:
- an init-param, or its default value.
-
resourcesFactory
Return theAtmosphereResourceFactory- Returns:
- the AtmosphereResourceFactory
-
metaBroadcaster
Return theDefaultMetaBroadcaster- Returns:
- the MetaBroadcaster
-
sessionFactory
Return theAtmosphereResourceSessionFactory- Returns:
- the AtmosphereResourceSessionFactory
-
uuidProvider
Return theUUIDProvider- Returns:
UUIDProvider
-
websocketFactory
Return theWebSocketFactory- Returns:
- the
WebSocketFactory
-
populate
-