Package org.atmosphere.cpr
Class AtmosphereConfig
- java.lang.Object
-
- org.atmosphere.cpr.AtmosphereConfig
-
public class AtmosphereConfig extends java.lang.ObjectThis class contains information about the current state of theAtmosphereFramework. You can also register aAtmosphereConfig.ShutdownHook.- Author:
- Sebastien Dionne : sebastien.dionne@gmail.com, Jeanfrancois Arcand
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAtmosphereConfig.ShutdownHookA shutdown hook that will be called when theAtmosphereFramework.destroy()method gets invoked.static interfaceAtmosphereConfig.StartupHookA Startup hook that will be called when theAtmosphereFramework.init()method complete.
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Loggerloggerprotected java.util.List<AtmosphereConfig.ShutdownHook>shutdownHooksprotected java.util.List<AtmosphereConfig.StartupHook>startUpHook
-
Constructor Summary
Constructors Modifier Constructor Description protectedAtmosphereConfig(AtmosphereFramework framework)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddestroy()InvokeAtmosphereConfig.ShutdownHooks.AtmosphereFrameworkframework()Return theAtmosphereFramework.java.util.List<AtmosphereHandlerConfig>getAtmosphereHandlerConfig()BroadcasterFactorygetBroadcasterFactory()Return an instance ofDefaultBroadcasterFactory.java.lang.StringgetInitParameter(java.lang.String name)Return the value of the init params defined in web.xml or application.xml.booleangetInitParameter(java.lang.String key, boolean defaultValue)Return an init-param, or its default value.intgetInitParameter(java.lang.String key, int defaultValue)Return an init-param, or its default value.java.lang.StringgetInitParameter(java.lang.String key, java.lang.String defaultValue)Return an init-param, or its default value.java.util.Enumeration<java.lang.String>getInitParameterNames()Return all init param.jakarta.servlet.ServletConfiggetServletConfig()Return theServletConfig.jakarta.servlet.ServletContextgetServletContext()Return theServletContext.java.lang.StringgetWebServerName()Return the current WebServer used.java.util.Map<java.lang.String,AtmosphereFramework.AtmosphereHandlerWrapper>handlers()Return the list ofAtmosphereFramework.AtmosphereHandlerWrappers.protected voidinitComplete()InvokeAtmosphereConfig.ShutdownHooks.booleanisSessionTimeoutRemovalAllowed()Allow HTTP session timeout removal when session support is activebooleanisSupportSession()IsHttpSessionsupported.booleanisThrowExceptionOnCloned()Is cloned request throws exception.MetaBroadcastermetaBroadcaster()Return theDefaultMetaBroadcasterAtmosphereConfigpopulate(AtmosphereConfig config)java.util.Map<java.lang.String,java.lang.Object>properties()Return theMapof Applications's properties.AtmosphereResourceFactoryresourcesFactory()Return theAtmosphereResourceFactoryAtmosphereResourceSessionFactorysessionFactory()Return theAtmosphereResourceSessionFactoryvoidsetSessionTimeoutRemovalAllowed(boolean sessionTimeoutRemovalAllowed)Enable/DisableHttpSessiontimeout removal when a connection exists.voidsetSupportSession(boolean supportSession)Enable/DisableHttpSession.voidsetThrowExceptionOnCloned(boolean throwExceptionOnCloned)Enable/Disable Exception on cloned request.AtmosphereConfigshutdownHook(AtmosphereConfig.ShutdownHook s)AtmosphereConfigstartupHook(AtmosphereConfig.StartupHook s)Add aAtmosphereConfig.StartupHook.UUIDProvideruuidProvider()Return theUUIDProviderWebSocketFactorywebsocketFactory()Return theWebSocketFactory
-
-
-
Field Detail
-
logger
protected static final org.slf4j.Logger logger
-
shutdownHooks
protected java.util.List<AtmosphereConfig.ShutdownHook> shutdownHooks
-
startUpHook
protected java.util.List<AtmosphereConfig.StartupHook> startUpHook
-
-
Constructor Detail
-
AtmosphereConfig
protected AtmosphereConfig(AtmosphereFramework framework)
-
-
Method Detail
-
getAtmosphereHandlerConfig
public java.util.List<AtmosphereHandlerConfig> getAtmosphereHandlerConfig()
-
framework
public AtmosphereFramework framework()
Return theAtmosphereFramework.- Returns:
- the
AtmosphereFramework
-
getServletConfig
public jakarta.servlet.ServletConfig getServletConfig()
Return theServletConfig.- Returns:
ServletConfig
-
getServletContext
public jakarta.servlet.ServletContext getServletContext()
Return theServletContext.- Returns:
ServletContext
-
getWebServerName
public java.lang.String getWebServerName()
Return the current WebServer used.- Returns:
- the current WebServer used
-
handlers
public java.util.Map<java.lang.String,AtmosphereFramework.AtmosphereHandlerWrapper> handlers()
Return the list ofAtmosphereFramework.AtmosphereHandlerWrappers.- Returns:
- the list of
AtmosphereFramework.AtmosphereHandlerWrapper
-
getInitParameter
public java.lang.String getInitParameter(java.lang.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 java.util.Enumeration<java.lang.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()
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
public BroadcasterFactory getBroadcasterFactory()
Return an instance ofDefaultBroadcasterFactory.- Returns:
- an instance of
DefaultBroadcasterFactory
-
properties
public java.util.Map<java.lang.String,java.lang.Object> 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
public AtmosphereConfig shutdownHook(AtmosphereConfig.ShutdownHook s)
- Parameters:
s- aAtmosphereConfig.ShutdownHook- Returns:
- this
-
startupHook
public AtmosphereConfig startupHook(AtmosphereConfig.StartupHook s)
Add aAtmosphereConfig.StartupHook. If theAtmosphereFramework.isInitreturn true, the StartupHook will be executed immediately.- Parameters:
s- aAtmosphereConfig.StartupHook- Returns:
- this
-
getInitParameter
public java.lang.String getInitParameter(java.lang.String key, java.lang.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(java.lang.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(java.lang.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 theAtmosphereResourceFactory- Returns:
- the AtmosphereResourceFactory
-
metaBroadcaster
public MetaBroadcaster metaBroadcaster()
Return theDefaultMetaBroadcaster- Returns:
- the MetaBroadcaster
-
sessionFactory
public AtmosphereResourceSessionFactory sessionFactory()
Return theAtmosphereResourceSessionFactory- Returns:
- the AtmosphereResourceSessionFactory
-
uuidProvider
public UUIDProvider uuidProvider()
Return theUUIDProvider- Returns:
UUIDProvider
-
websocketFactory
public WebSocketFactory websocketFactory()
Return theWebSocketFactory- Returns:
- the
WebSocketFactory
-
populate
public AtmosphereConfig populate(AtmosphereConfig config)
-
-