org.atmosphere.cpr
Class AtmosphereFramework

java.lang.Object
  extended by org.atmosphere.cpr.AtmosphereFramework
All Implemented Interfaces:
ServletContextProvider

public class AtmosphereFramework
extends Object
implements ServletContextProvider

The AtmosphereFramework is the entry point for the framework. This class can be used to from Servlet/filter to dispatch AtmosphereRequest and AtmosphereResponse. The framework can also be configured using the setXXX method. The life cycle of this class is

 AtmosphereFramework f = new AtmosphereFramework();
 f.init();
 f.doCometSupport(AtmosphereRequest, AtmosphereResource);
 f.destroy();
 

Author:
Jeanfrancois Arcand

Nested Class Summary
static class AtmosphereFramework.AtmosphereHandlerWrapper
           
 
Field Summary
protected  String annotationProcessorClassName
           
protected  AsyncSupport asyncSupport
           
protected  List<AsyncSupportListener> asyncSupportListeners
           
protected  String atmosphereDotXmlPath
           
protected  Map<String,AtmosphereFramework.AtmosphereHandlerWrapper> atmosphereHandlers
           
protected  boolean autoDetectHandlers
           
protected  String broadcasterCacheClassName
           
protected  String broadcasterClassName
           
protected  BroadcasterFactory broadcasterFactory
           
protected  String broadcasterFactoryClassName
           
protected  List<String> broadcasterFilters
           
protected  String broadcasterLifeCyclePolicy
           
protected  List<BroadcasterListener> broadcasterListeners
           
protected  ConcurrentLinkedQueue<String> broadcasterTypes
           
protected  AtmosphereConfig config
           
static String DEFAULT_ATMOSPHERE_CONFIG_PATH
           
static String DEFAULT_LIB_PATH
           
protected  String handlersPath
           
protected  HashMap<String,String> initParams
           
protected  LinkedList<AtmosphereInterceptor> interceptors
           
protected  boolean isBroadcasterSpecified
           
protected  AtomicBoolean isCometSupportConfigured
           
protected  boolean isCometSupportSpecified
           
protected  boolean isFilter
           
protected  boolean isInit
           
protected  boolean isSessionSupportSpecified
           
protected  String libPath
           
protected static org.slf4j.Logger logger
           
static String MAPPING_REGEX
           
protected  List<String> packages
           
protected  ArrayList<String> possibleComponentsCandidate
           
protected  boolean scanDone
           
protected  javax.servlet.ServletConfig servletConfig
           
protected  boolean sharedThreadPools
           
protected  boolean useBlockingImplementation
           
protected  boolean useNativeImplementation
           
protected  boolean useStreamForFlushingComments
           
protected  boolean webSocketEnabled
           
protected  String webSocketProcessorClassName
           
protected  WebSocketProtocol webSocketProtocol
           
protected  String webSocketProtocolClassName
           
 
Constructor Summary
AtmosphereFramework()
          Create an AtmosphereFramework.
AtmosphereFramework(boolean isFilter, boolean autoDetectHandlers)
          Create an AtmosphereFramework.
AtmosphereFramework(javax.servlet.ServletConfig sc)
          Create an AtmosphereFramework and initialize it via init(javax.servlet.ServletConfig)
 
Method Summary
 AtmosphereFramework addAnnotationPackage(Class<?> clazz)
          Add support for package detecttion of Atmosphere's Component.
 AtmosphereFramework addAtmosphereHandler(String mapping, AtmosphereHandler h)
          Add an AtmosphereHandler serviced by the Servlet This API is exposed to allow embedding an Atmosphere application.
 AtmosphereFramework addAtmosphereHandler(String mapping, AtmosphereHandler h, Broadcaster broadcaster)
          Add an AtmosphereHandler serviced by the Servlet This API is exposed to allow embedding an Atmosphere application.
 AtmosphereFramework addAtmosphereHandler(String mapping, AtmosphereHandler h, Broadcaster broadcaster, List<AtmosphereInterceptor> l)
          Add an AtmosphereHandler serviced by the Servlet This API is exposed to allow embedding an Atmosphere application.
 AtmosphereFramework addAtmosphereHandler(String mapping, AtmosphereHandler h, List<AtmosphereInterceptor> l)
          Add an AtmosphereHandler serviced by the Servlet This API is exposed to allow embedding an Atmosphere application.
 AtmosphereFramework addAtmosphereHandler(String mapping, AtmosphereHandler h, String broadcasterId)
          Add an AtmosphereHandler serviced by the Servlet This API is exposed to allow embedding an Atmosphere application.
 AtmosphereFramework addAtmosphereHandler(String mapping, AtmosphereHandler h, String broadcasterId, List<AtmosphereInterceptor> l)
          Add an AtmosphereHandler serviced by the Servlet This API is exposed to allow embedding an Atmosphere application.
 AtmosphereFramework addBroadcasterListener(BroadcasterListener b)
          Add BroadcasterListener to all created Broadcaster
 AtmosphereFramework addBroadcasterType(String broadcasterTypeString)
          Add a new Broadcaster class name AtmosphereServlet can use when initializing requests, and when atmosphere.xml broadcaster element is unspecified.
 AtmosphereFramework addInitParameter(String name, String value)
          Add init-param like if they were defined in web.xml
protected  void analytics()
           
 AtmosphereFramework annotationProcessorClassName(String annotationProcessorClassName)
          Set the AnnotationProcessor class name.
 AtmosphereFramework asyncSupportListener(AsyncSupportListener asyncSupportListener)
          Add an AsyncSupportListener
 List<AsyncSupportListener> asyncSupportListeners()
          Return the list of an AsyncSupportListener
protected  void autoConfigureService(javax.servlet.ServletContext sc)
           
 void autoDetectAtmosphereHandlers(javax.servlet.ServletContext servletContext, URLClassLoader classloader)
          Auto detect instance of AtmosphereHandler in case META-INF/atmosphere.xml is missing.
protected  void autoDetectContainer()
          Auto detect the underlying Servlet Container we are running on.
protected  void autoDetectWebSocketHandler(javax.servlet.ServletContext servletContext, URLClassLoader classloader)
          Auto detect instance of WebSocketHandler in case META-INF/atmosphere.xml is missing.
 List<String> broadcasterFilters()
          Return the list of BroadcastFilter
protected  void configureAtmosphereInterceptor(javax.servlet.ServletConfig sc)
          Configure the list of AtmosphereInterceptor.
protected  void configureBroadcaster()
           
protected  void configureBroadcasterFactory()
           
protected  Map<String,String> configureQueryStringAsRequest(AtmosphereRequest request)
           
protected  void configureScanningPackage(javax.servlet.ServletConfig sc)
           
protected  void configureWebDotXmlAtmosphereHandler(javax.servlet.ServletConfig sc)
           
protected  AsyncSupportResolver createAsyncSupportResolver()
          Returns an instance of AsyncSupportResolver AsyncSupportResolver
 AtmosphereFramework destroy()
           
protected  boolean detectSupportedFramework(javax.servlet.ServletConfig sc)
          Auto-detect Jersey when no atmosphere.xml file are specified.
 Action doCometSupport(AtmosphereRequest req, AtmosphereResponse res)
          Invoke the proprietary AsyncSupport
protected  void doInitParams(javax.servlet.ServletConfig sc)
          Read init param from web.xml and apply them.
protected  void doInitParamsForWebSocket(javax.servlet.ServletConfig sc)
           
 AsyncSupport getAsyncSupport()
          Return the current AsyncSupport
 AtmosphereConfig getAtmosphereConfig()
          Return a configured instance of AtmosphereConfig
 String getAtmosphereDotXmlPath()
           
 Map<String,AtmosphereFramework.AtmosphereHandlerWrapper> getAtmosphereHandlers()
           
 String getBroadcasterCacheClassName()
          Return the BroadcasterCache class name.
 BroadcasterFactory getBroadcasterFactory()
          Get the BroadcasterFactory which is used by Atmosphere to construct Broadcaster
 AsyncSupport getCometSupport()
          Deprecated. Use getAsyncSupport
 String getDefaultBroadcasterClassName()
          Return the default Broadcaster class name.
 String getHandlersPath()
           
 String getLibPath()
          Return the location of the jars containing the application classes.
 javax.servlet.ServletConfig getServletConfig()
           
 javax.servlet.ServletContext getServletContext()
           
 String getWebSocketProcessorClassName()
           
 WebSocketProtocol getWebSocketProtocol()
           
 String getWebSocketProtocolClassName()
           
 AtmosphereFramework init()
          Initialize the AtmosphereFramework.
 AtmosphereFramework init(javax.servlet.ServletConfig sc)
          Initialize the AtmosphereFramework using the ServletContext
 void initAtmosphereHandler(javax.servlet.ServletConfig sc)
          Initialize AtmosphereServletProcessor
protected  void initWebSocket()
           
 AtmosphereFramework interceptor(AtmosphereInterceptor c)
          Add an AtmosphereInterceptor implementation.
 LinkedList<AtmosphereInterceptor> interceptors()
          Return the list of AtmosphereInterceptor
protected  boolean isIECandidate(AtmosphereRequest request)
           
 boolean isShareExecutorServices()
          Returns true if ExecutorService shared amongst all components.
 boolean isUseBlockingImplementation()
           
 boolean isUseNativeImplementation()
           
 boolean isUseStreamForFlushingComments()
          true if Atmosphere uses AtmosphereResponse.getOutputStream() by default for write operation.
protected  void loadAtmosphereDotXml(InputStream stream, URLClassLoader c)
          Load AtmosphereHandler defined under META-INF/atmosphere.xml
 void loadAtmosphereHandlersFromPath(URLClassLoader classloader, String realPath)
           
 void loadConfiguration(javax.servlet.ServletConfig sc)
           
protected  void loadWebSocketFromPath(URLClassLoader classloader, String realPath)
           
protected  String lookupDefaultBroadcasterType(String defaultB)
           
protected  AtmosphereInterceptor newAInterceptor(Class<? extends AtmosphereInterceptor> a)
           
protected  void notify(Action.TYPE type, AtmosphereRequest request, AtmosphereResponse response)
           
 void patchContainer()
          Path specific container using their own property.
protected  void readSystemProperties()
           
 AtmosphereFramework removeAllAtmosphereHandler()
          Remove all AtmosphereHandler
 AtmosphereFramework removeAllInitParams()
          Remove all init parameters.
 AtmosphereFramework removeAtmosphereHandler(String mapping)
          Remove an AtmosphereHandler
protected  void sessionSupport(boolean sessionSupport)
           
 AtmosphereFramework setAsyncSupport(AsyncSupport asyncSupport)
          Set the AsyncSupport implementation.
 AtmosphereFramework setAtmosphereDotXmlPath(String atmosphereDotXmlPath)
           
 void setBroadcasterCacheClassName(String broadcasterCacheClassName)
          Set the BroadcasterCache class name.
 AtmosphereFramework setBroadcasterFactory(BroadcasterFactory broadcasterFactory)
          Set the BroadcasterFactory which is used by Atmosphere to construct Broadcaster
 AtmosphereFramework setCometSupport(AsyncSupport asyncSupport)
           
 AtmosphereFramework setDefaultBroadcasterClassName(String bccn)
          Set the default Broadcaster class name
 AtmosphereFramework setHandlersPath(String handlersPath)
           
 AtmosphereFramework setLibPath(String libPath)
          Set the location of the jars containing the application.
 AtmosphereFramework setUseBlockingImplementation(boolean useBlockingImplementation)
           
 AtmosphereFramework setUseNativeImplementation(boolean useNativeImplementation)
           
 AtmosphereFramework setUseStreamForFlushingComments(boolean useStreamForFlushingComments)
          Set to true so Atmosphere uses AtmosphereResponse.getOutputStream() by default for write operation.
 AtmosphereFramework setWebsocketProcessorClassName(String webSocketProcessorClassName)
           
 AtmosphereFramework setWebSocketProtocolClassName(String webSocketProtocolClassName)
           
 AtmosphereFramework shareExecutorServices(boolean sharedThreadPools)
          Set to true to have a ExecutorService shared amongst all components.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ATMOSPHERE_CONFIG_PATH

public static final String DEFAULT_ATMOSPHERE_CONFIG_PATH
See Also:
Constant Field Values

DEFAULT_LIB_PATH

public static final String DEFAULT_LIB_PATH
See Also:
Constant Field Values

MAPPING_REGEX

public static final String MAPPING_REGEX
See Also:
Constant Field Values

logger

protected static final org.slf4j.Logger logger

broadcasterFilters

protected final List<String> broadcasterFilters

asyncSupportListeners

protected final List<AsyncSupportListener> asyncSupportListeners

possibleComponentsCandidate

protected final ArrayList<String> possibleComponentsCandidate

initParams

protected final HashMap<String,String> initParams

config

protected final AtmosphereConfig config

isCometSupportConfigured

protected final AtomicBoolean isCometSupportConfigured

isFilter

protected final boolean isFilter

atmosphereHandlers

protected final Map<String,AtmosphereFramework.AtmosphereHandlerWrapper> atmosphereHandlers

broadcasterTypes

protected final ConcurrentLinkedQueue<String> broadcasterTypes

useNativeImplementation

protected boolean useNativeImplementation

useBlockingImplementation

protected boolean useBlockingImplementation

useStreamForFlushingComments

protected boolean useStreamForFlushingComments

asyncSupport

protected AsyncSupport asyncSupport

broadcasterClassName

protected String broadcasterClassName

isCometSupportSpecified

protected boolean isCometSupportSpecified

isBroadcasterSpecified

protected boolean isBroadcasterSpecified

isSessionSupportSpecified

protected boolean isSessionSupportSpecified

broadcasterFactory

protected BroadcasterFactory broadcasterFactory

broadcasterFactoryClassName

protected String broadcasterFactoryClassName

broadcasterCacheClassName

protected String broadcasterCacheClassName

webSocketEnabled

protected boolean webSocketEnabled

broadcasterLifeCyclePolicy

protected String broadcasterLifeCyclePolicy

webSocketProtocolClassName

protected String webSocketProtocolClassName

webSocketProtocol

protected WebSocketProtocol webSocketProtocol

handlersPath

protected String handlersPath

servletConfig

protected javax.servlet.ServletConfig servletConfig

autoDetectHandlers

protected boolean autoDetectHandlers

atmosphereDotXmlPath

protected String atmosphereDotXmlPath

interceptors

protected final LinkedList<AtmosphereInterceptor> interceptors

scanDone

protected boolean scanDone

annotationProcessorClassName

protected String annotationProcessorClassName

broadcasterListeners

protected final List<BroadcasterListener> broadcasterListeners

webSocketProcessorClassName

protected String webSocketProcessorClassName

libPath

protected String libPath

isInit

protected boolean isInit

sharedThreadPools

protected boolean sharedThreadPools

packages

protected final List<String> packages
Constructor Detail

AtmosphereFramework

public AtmosphereFramework()
Create an AtmosphereFramework.


AtmosphereFramework

public AtmosphereFramework(javax.servlet.ServletConfig sc)
                    throws javax.servlet.ServletException
Create an AtmosphereFramework and initialize it via init(javax.servlet.ServletConfig)

Throws:
javax.servlet.ServletException

AtmosphereFramework

public AtmosphereFramework(boolean isFilter,
                           boolean autoDetectHandlers)
Create an AtmosphereFramework.

Parameters:
isFilter - true if this instance is used as an AtmosphereFilter
Method Detail

addAtmosphereHandler

public AtmosphereFramework addAtmosphereHandler(String mapping,
                                                AtmosphereHandler h,
                                                List<AtmosphereInterceptor> l)
Add an AtmosphereHandler serviced by the Servlet This API is exposed to allow embedding an Atmosphere application.

Parameters:
mapping - The servlet mapping (servlet path)
h - implementation of an AtmosphereHandler
l - An attay of AtmosphereInterceptor

addAtmosphereHandler

public AtmosphereFramework addAtmosphereHandler(String mapping,
                                                AtmosphereHandler h)
Add an AtmosphereHandler serviced by the Servlet This API is exposed to allow embedding an Atmosphere application.

Parameters:
mapping - The servlet mapping (servlet path)
h - implementation of an AtmosphereHandler

addAtmosphereHandler

public AtmosphereFramework addAtmosphereHandler(String mapping,
                                                AtmosphereHandler h,
                                                String broadcasterId,
                                                List<AtmosphereInterceptor> l)
Add an AtmosphereHandler serviced by the Servlet This API is exposed to allow embedding an Atmosphere application.

Parameters:
mapping - The servlet mapping (servlet path)
h - implementation of an AtmosphereHandler
broadcasterId - The Broadcaster.getID() value.
l - An attay of AtmosphereInterceptor

addAtmosphereHandler

public AtmosphereFramework addAtmosphereHandler(String mapping,
                                                AtmosphereHandler h,
                                                String broadcasterId)
Add an AtmosphereHandler serviced by the Servlet This API is exposed to allow embedding an Atmosphere application.

Parameters:
mapping - The servlet mapping (servlet path)
h - implementation of an AtmosphereHandler
broadcasterId - The Broadcaster.getID() value.

addAtmosphereHandler

public AtmosphereFramework addAtmosphereHandler(String mapping,
                                                AtmosphereHandler h,
                                                Broadcaster broadcaster,
                                                List<AtmosphereInterceptor> l)
Add an AtmosphereHandler serviced by the Servlet This API is exposed to allow embedding an Atmosphere application.

Parameters:
mapping - The servlet mapping (servlet path)
h - implementation of an AtmosphereHandler
broadcaster - The Broadcaster associated with AtmosphereHandler.
l - An attay of AtmosphereInterceptor

addAtmosphereHandler

public AtmosphereFramework addAtmosphereHandler(String mapping,
                                                AtmosphereHandler h,
                                                Broadcaster broadcaster)
Add an AtmosphereHandler serviced by the Servlet This API is exposed to allow embedding an Atmosphere application.

Parameters:
mapping - The servlet mapping (servlet path)
h - implementation of an AtmosphereHandler
broadcaster - The Broadcaster associated with AtmosphereHandler.

removeAtmosphereHandler

public AtmosphereFramework removeAtmosphereHandler(String mapping)
Remove an AtmosphereHandler

Parameters:
mapping - the mapping used when invoking addAtmosphereHandler(String, AtmosphereHandler);
Returns:
true if removed

removeAllAtmosphereHandler

public AtmosphereFramework removeAllAtmosphereHandler()
Remove all AtmosphereHandler


removeAllInitParams

public AtmosphereFramework removeAllInitParams()
Remove all init parameters.


addInitParameter

public AtmosphereFramework addInitParameter(String name,
                                            String value)
Add init-param like if they were defined in web.xml

Parameters:
name - The name
value - The value

readSystemProperties

protected void readSystemProperties()

patchContainer

public void patchContainer()
Path specific container using their own property.


init

public AtmosphereFramework init()
Initialize the AtmosphereFramework. Invoke that method after having properly configured this class using the setter.


init

public AtmosphereFramework init(javax.servlet.ServletConfig sc)
                         throws javax.servlet.ServletException
Initialize the AtmosphereFramework using the ServletContext

Parameters:
sc - the ServletContext
Throws:
javax.servlet.ServletException

analytics

protected void analytics()

configureAtmosphereInterceptor

protected void configureAtmosphereInterceptor(javax.servlet.ServletConfig sc)
Configure the list of AtmosphereInterceptor.

Parameters:
sc - a ServletConfig

newAInterceptor

protected AtmosphereInterceptor newAInterceptor(Class<? extends AtmosphereInterceptor> a)

configureWebDotXmlAtmosphereHandler

protected void configureWebDotXmlAtmosphereHandler(javax.servlet.ServletConfig sc)

configureScanningPackage

protected void configureScanningPackage(javax.servlet.ServletConfig sc)

configureBroadcasterFactory

protected void configureBroadcasterFactory()

configureBroadcaster

protected void configureBroadcaster()

doInitParamsForWebSocket

protected void doInitParamsForWebSocket(javax.servlet.ServletConfig sc)

doInitParams

protected void doInitParams(javax.servlet.ServletConfig sc)
Read init param from web.xml and apply them.

Parameters:
sc - ServletConfig

loadConfiguration

public void loadConfiguration(javax.servlet.ServletConfig sc)
                       throws javax.servlet.ServletException
Throws:
javax.servlet.ServletException

detectSupportedFramework

protected boolean detectSupportedFramework(javax.servlet.ServletConfig sc)
                                    throws ClassNotFoundException,
                                           IllegalAccessException,
                                           InstantiationException,
                                           NoSuchMethodException,
                                           InvocationTargetException
Auto-detect Jersey when no atmosphere.xml file are specified.

Parameters:
sc - ServletConfig
Returns:
true if Jersey classes are detected
Throws:
ClassNotFoundException
IllegalAccessException
InstantiationException
NoSuchMethodException
InvocationTargetException

lookupDefaultBroadcasterType

protected String lookupDefaultBroadcasterType(String defaultB)

sessionSupport

protected void sessionSupport(boolean sessionSupport)

initAtmosphereHandler

public void initAtmosphereHandler(javax.servlet.ServletConfig sc)
                           throws javax.servlet.ServletException
Initialize AtmosphereServletProcessor

Parameters:
sc - the ServletConfig
Throws:
javax.servlet.ServletException

initWebSocket

protected void initWebSocket()

destroy

public AtmosphereFramework destroy()

loadAtmosphereDotXml

protected void loadAtmosphereDotXml(InputStream stream,
                                    URLClassLoader c)
                             throws IOException,
                                    javax.servlet.ServletException
Load AtmosphereHandler defined under META-INF/atmosphere.xml

Parameters:
stream - The input stream we read from.
c - The classloader
Throws:
IOException
javax.servlet.ServletException

setAsyncSupport

public AtmosphereFramework setAsyncSupport(AsyncSupport asyncSupport)
Set the AsyncSupport implementation. Make sure you don't set an implementation that only works on some Container. See BlockingIOCometSupport for an example.

Parameters:
asyncSupport -

setCometSupport

public AtmosphereFramework setCometSupport(AsyncSupport asyncSupport)
Parameters:
asyncSupport -
Returns:

getAsyncSupport

public AsyncSupport getAsyncSupport()
Return the current AsyncSupport

Returns:
the current AsyncSupport

getCometSupport

public AsyncSupport getCometSupport()
Deprecated. Use getAsyncSupport

Return the current AsyncSupport

Returns:
the current AsyncSupport

createAsyncSupportResolver

protected AsyncSupportResolver createAsyncSupportResolver()
Returns an instance of AsyncSupportResolver AsyncSupportResolver

Returns:
CometSupportResolver

autoDetectContainer

protected void autoDetectContainer()
Auto detect the underlying Servlet Container we are running on.


autoDetectAtmosphereHandlers

public void autoDetectAtmosphereHandlers(javax.servlet.ServletContext servletContext,
                                         URLClassLoader classloader)
                                  throws MalformedURLException,
                                         URISyntaxException
Auto detect instance of AtmosphereHandler in case META-INF/atmosphere.xml is missing.

Parameters:
servletContext - ServletContext
classloader - URLClassLoader to load the class.
Throws:
MalformedURLException
URISyntaxException

loadAtmosphereHandlersFromPath

public void loadAtmosphereHandlersFromPath(URLClassLoader classloader,
                                           String realPath)

autoDetectWebSocketHandler

protected void autoDetectWebSocketHandler(javax.servlet.ServletContext servletContext,
                                          URLClassLoader classloader)
                                   throws MalformedURLException,
                                          URISyntaxException
Auto detect instance of WebSocketHandler in case META-INF/atmosphere.xml is missing.

Parameters:
servletContext - ServletContext
classloader - URLClassLoader to load the class.
Throws:
MalformedURLException
URISyntaxException

loadWebSocketFromPath

protected void loadWebSocketFromPath(URLClassLoader classloader,
                                     String realPath)

doCometSupport

public Action doCometSupport(AtmosphereRequest req,
                             AtmosphereResponse res)
                      throws IOException,
                             javax.servlet.ServletException
Invoke the proprietary AsyncSupport

Parameters:
req -
res -
Returns:
an Action
Throws:
IOException
javax.servlet.ServletException

getDefaultBroadcasterClassName

public String getDefaultBroadcasterClassName()
Return the default Broadcaster class name.

Returns:
the broadcasterClassName

setDefaultBroadcasterClassName

public AtmosphereFramework setDefaultBroadcasterClassName(String bccn)
Set the default Broadcaster class name

Parameters:
bccn - the broadcasterClassName to set

isUseStreamForFlushingComments

public boolean isUseStreamForFlushingComments()
true if Atmosphere uses AtmosphereResponse.getOutputStream() by default for write operation.

Returns:
the useStreamForFlushingComments

setUseStreamForFlushingComments

public AtmosphereFramework setUseStreamForFlushingComments(boolean useStreamForFlushingComments)
Set to true so Atmosphere uses AtmosphereResponse.getOutputStream() by default for write operation. Default is false.

Parameters:
useStreamForFlushingComments - the useStreamForFlushingComments to set

getBroadcasterFactory

public BroadcasterFactory getBroadcasterFactory()
Get the BroadcasterFactory which is used by Atmosphere to construct Broadcaster

Returns:
BroadcasterFactory

setBroadcasterFactory

public AtmosphereFramework setBroadcasterFactory(BroadcasterFactory broadcasterFactory)
Set the BroadcasterFactory which is used by Atmosphere to construct Broadcaster

Returns:
BroadcasterFactory

getBroadcasterCacheClassName

public String getBroadcasterCacheClassName()
Return the BroadcasterCache class name.

Returns:
the BroadcasterCache class name.

setBroadcasterCacheClassName

public void setBroadcasterCacheClassName(String broadcasterCacheClassName)
Set the BroadcasterCache class name.

Parameters:
broadcasterCacheClassName -

addBroadcasterType

public AtmosphereFramework addBroadcasterType(String broadcasterTypeString)
Add a new Broadcaster class name AtmosphereServlet can use when initializing requests, and when atmosphere.xml broadcaster element is unspecified.

Parameters:
broadcasterTypeString -

getWebSocketProtocolClassName

public String getWebSocketProtocolClassName()

setWebSocketProtocolClassName

public AtmosphereFramework setWebSocketProtocolClassName(String webSocketProtocolClassName)

getAtmosphereHandlers

public Map<String,AtmosphereFramework.AtmosphereHandlerWrapper> getAtmosphereHandlers()

configureQueryStringAsRequest

protected Map<String,String> configureQueryStringAsRequest(AtmosphereRequest request)

isIECandidate

protected boolean isIECandidate(AtmosphereRequest request)

getWebSocketProtocol

public WebSocketProtocol getWebSocketProtocol()

isUseNativeImplementation

public boolean isUseNativeImplementation()

setUseNativeImplementation

public AtmosphereFramework setUseNativeImplementation(boolean useNativeImplementation)

isUseBlockingImplementation

public boolean isUseBlockingImplementation()

setUseBlockingImplementation

public AtmosphereFramework setUseBlockingImplementation(boolean useBlockingImplementation)

getAtmosphereDotXmlPath

public String getAtmosphereDotXmlPath()

setAtmosphereDotXmlPath

public AtmosphereFramework setAtmosphereDotXmlPath(String atmosphereDotXmlPath)

getHandlersPath

public String getHandlersPath()

setHandlersPath

public AtmosphereFramework setHandlersPath(String handlersPath)

getLibPath

public String getLibPath()
Return the location of the jars containing the application classes. Default is WEB-INF/lib

Returns:
the location of the jars containing the application classes. Default is WEB-INF/lib

setLibPath

public AtmosphereFramework setLibPath(String libPath)
Set the location of the jars containing the application.

Parameters:
libPath - the location of the jars containing the application.
Returns:
this

getWebSocketProcessorClassName

public String getWebSocketProcessorClassName()

setWebsocketProcessorClassName

public AtmosphereFramework setWebsocketProcessorClassName(String webSocketProcessorClassName)

interceptor

public AtmosphereFramework interceptor(AtmosphereInterceptor c)
Add an AtmosphereInterceptor implementation. The adding order or AtmosphereInterceptor will be used, e.g the first added AtmosphereInterceptor will always be called first.

Parameters:
c - AtmosphereInterceptor
Returns:
this

interceptors

public LinkedList<AtmosphereInterceptor> interceptors()
Return the list of AtmosphereInterceptor

Returns:
the list of AtmosphereInterceptor

annotationProcessorClassName

public AtmosphereFramework annotationProcessorClassName(String annotationProcessorClassName)
Set the AnnotationProcessor class name.

Parameters:
annotationProcessorClassName - the AnnotationProcessor class name.
Returns:
this

asyncSupportListener

public AtmosphereFramework asyncSupportListener(AsyncSupportListener asyncSupportListener)
Add an AsyncSupportListener

Parameters:
asyncSupportListener - an AsyncSupportListener
Returns:
this;

asyncSupportListeners

public List<AsyncSupportListener> asyncSupportListeners()
Return the list of an AsyncSupportListener

Returns:

addBroadcasterListener

public AtmosphereFramework addBroadcasterListener(BroadcasterListener b)
Add BroadcasterListener to all created Broadcaster


getAtmosphereConfig

public AtmosphereConfig getAtmosphereConfig()
Return a configured instance of AtmosphereConfig

Returns:
a configured instance of AtmosphereConfig

getServletContext

public javax.servlet.ServletContext getServletContext()
Specified by:
getServletContext in interface ServletContextProvider

getServletConfig

public javax.servlet.ServletConfig getServletConfig()

broadcasterFilters

public List<String> broadcasterFilters()
Return the list of BroadcastFilter

Returns:
the list of {@link BroadcastFilter

isShareExecutorServices

public boolean isShareExecutorServices()
Returns true if ExecutorService shared amongst all components.

Returns:
true if ExecutorService shared amongst all components.

shareExecutorServices

public AtmosphereFramework shareExecutorServices(boolean sharedThreadPools)
Set to true to have a ExecutorService shared amongst all components.

Parameters:
sharedThreadPools -
Returns:
this

autoConfigureService

protected void autoConfigureService(javax.servlet.ServletContext sc)
                             throws IOException
Throws:
IOException

addAnnotationPackage

public AtmosphereFramework addAnnotationPackage(Class<?> clazz)
Add support for package detecttion of Atmosphere's Component.

Parameters:
clazz - a Class
Returns:
this.

notify

protected void notify(Action.TYPE type,
                      AtmosphereRequest request,
                      AtmosphereResponse response)


Copyright © 2013. All Rights Reserved.