org.atmosphere.cpr
Class AtmosphereServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.eclipse.jetty.websocket.WebSocketServlet
              extended by weblogic.servlet.http.AbstractAsyncServlet
                  extended by org.atmosphere.cpr.AtmosphereServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, CometProcessor, ServletContextProvider, WebSocketFactory.Acceptor, HttpEventServlet
Direct Known Subclasses:
MeteorServlet

public class AtmosphereServlet
extends AbstractAsyncServlet
implements CometProcessor, HttpEventServlet, ServletContextProvider, CometProcessor

The AtmosphereServlet acts as a dispatcher for AtmosphereHandler defined in META-INF/atmosphere.xml, or if atmosphere.xml is missing, all classes that implements AtmosphereHandler will be discovered and mapped using the class's name.

This Servlet can be defined inside an application's web.xml using the following:

  <servlet>
      <description>AtmosphereServlet</description>
      <servlet-name>AtmosphereServlet</servlet-name>
      <servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class>
      <load-on-startup>0 </load-on-startup>
  </servlet>
  <servlet-mapping>
      <servlet-name>AtmosphereServlet</servlet-name>
      <url-pattern>/Atmosphere </url-pattern>
  </servlet-mapping>
 
You can force this Servlet to use native API of the Web Server instead of the Servlet 3.0 Async API you are deploying on by adding
  <init-param>
      <param-name>org.atmosphere.useNative</param-name>
      <param-value>true</param-value>
  </init-param>
 
You can force this Servlet to use one Thread per connection instead of native API of the Web Server you are deploying on by adding
  <init-param>
      <param-name>org.atmosphere.useBlocking</param-name>
      <param-value>true</param-value>
  </init-param>
 
You can also define Broadcasterby adding:
  <init-param>
      <param-name>org.atmosphere.cpr.broadcasterClass</param-name>
      <param-value>class-name</param-value>
  </init-param>
 
You can also for Atmosphere to use OutputStream for all write operations.
  <init-param>
      <param-name>org.atmosphere.useStream</param-name>
      <param-value>true</param-value>
  </init-param>
 
You can also configure BroadcasterCache that persist message when Browser is disconnected.
  <init-param>
      <param-name>org.atmosphere.cpr.broadcasterCacheClass</param-name>
      <param-value>class-name</param-value>
  </init-param>
 
You can also configure Atmosphere to use http session or not
  <init-param>
      <param-name>org.atmosphere.cpr.sessionSupport</param-name>
      <param-value>false</param-value>
  </init-param>
 
You can also configure BroadcastFilter that will be applied at all newly created Broadcaster
  <init-param>
      <param-name>org.atmosphere.cpr.broadcastFilterClasses</param-name>
      <param-value>BroadcastFilter class name separated by coma</param-value>
  </init-param>
 
All the property available are defined in ApplicationConfig The Atmosphere Framework can also be used as a Servlet Filter (AtmosphereFilter).

If you are planning to use JSP, Servlet or JSF, you can instead use the MeteorServlet, which allow the use of Meteor inside those components.

Author:
Jeanfrancois Arcand
See Also:
Serialized Form

Nested Class Summary
static class AtmosphereServlet.Action
          Simple class/struck that hold the current state.
 class AtmosphereServlet.AtmosphereConfig
           
static class AtmosphereServlet.AtmosphereHandlerWrapper
           
 
Field Summary
protected  Map<String,AtmosphereServlet.AtmosphereHandlerWrapper> atmosphereHandlers
          The list of AtmosphereHandler and their associated mapping.
protected static String broadcasterCacheClassName
           
protected static String broadcasterClassName
           
protected  String broadcasterFactoryClassName
           
static String[] broadcasterFilters
           
protected  CometSupport cometSupport
           
protected  AtmosphereServlet.AtmosphereConfig config
           
protected  boolean isBroadcasterSpecified
           
protected  AtomicBoolean isCometSupportConfigured
           
protected  boolean isCometSupportSpecified
           
protected  boolean isFilter
           
protected  boolean isSessionSupportSpecified
           
protected  boolean useBlockingImplementation
           
protected  boolean useNativeImplementation
           
protected  boolean useStreamForFlushingComments
           
 
Constructor Summary
AtmosphereServlet()
          Create an Atmosphere Servlet.
AtmosphereServlet(boolean isFilter)
          Create an Atmosphere Servlet.
 
Method Summary
 void addAtmosphereHandler(String mapping, AtmosphereHandler h)
          Add an AtmosphereHandler serviced by the Servlet This API is exposed to allow embedding an Atmosphere application.
 void addAtmosphereHandler(String mapping, AtmosphereHandler<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse> h, Broadcaster broadcaster)
          Add an AtmosphereHandler serviced by the Servlet This API is exposed to allow embedding an Atmosphere application.
 void addAtmosphereHandler(String mapping, AtmosphereHandler h, String broadcasterId)
          Add an AtmosphereHandler serviced by the Servlet This API is exposed to allow embedding an Atmosphere application.
 void addBroadcasterType(String broadcasterTypeString)
          Add a new Broadcaster class name AtmosphereServlet can use when initializing requests, and when atmosphere.xml broadcaster element is unspecified.
 void addInitParameter(String name, String value)
          Add init-param like if they were defined in web.xml
protected  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 configureBroadcaster(javax.servlet.ServletContext sc)
           
protected  Map<String,String> configureQueryStringAsRequest(javax.servlet.http.HttpServletRequest request)
           
protected  void configureWebDotXmlAtmosphereHandler(javax.servlet.ServletConfig sc)
           
protected  CometSupportResolver createCometSupportResolver()
          Returns an instance of CometSupportResolver CometSupportResolver
 void destroy()
           
protected  boolean detectSupportedFramework(javax.servlet.ServletConfig sc)
          Auto-detect Jersey when no atmosphere.xml file are specified.
 AtmosphereServlet.Action doCometSupport(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Invoke the proprietary CometSupport
 void doDelete(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Delegate the request processing to an instance of CometSupport
 void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Delegate the request processing to an instance of CometSupport
 void doHead(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Delegate the request processing to an instance of CometSupport
protected  void doInitParams(javax.servlet.ServletConfig sc)
          Read init param from web.xml and apply them.
protected  void doInitParamsForWebSocket(javax.servlet.ServletConfig sc)
           
 void doOptions(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Delegate the request processing to an instance of CometSupport
 void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Delegate the request processing to an instance of CometSupport
 void doPut(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Delegate the request processing to an instance of CometSupport
protected  boolean doRequest(RequestResponseKey rrk)
          Weblogic specific comet based implementation.
protected  void doResponse(RequestResponseKey rrk, Object context)
          Weblogic specific comet based implementation.
protected  void doTimeout(RequestResponseKey rrk)
          Weblogic specific comet based implementation.
 void doTrace(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Delegate the request processing to an instance of CometSupport
 WebSocket doWebSocketConnect(javax.servlet.http.HttpServletRequest request, String protocol)
          Jetty 7.2 & 8.0.0-M1/M2and up WebSocket support.
 void event(CometEvent cometEvent)
          Hack to support Tomcat AIO like other WebServer.
 void event(CometEvent cometEvent)
          Hack to support Tomcat 7 AIO
 void event(HttpEvent httpEvent)
          Hack to support JBossWeb AIO like other WebServer.
 AtmosphereServlet.AtmosphereConfig getAtmosphereConfig()
          Return a configured instance of AtmosphereServlet.AtmosphereConfig
 String getBroadcasterCacheClassName()
          Return the BroadcasterCache class name.
 BroadcasterFactory getBroadcasterFactory()
          Get the BroadcasterFactory which is used by Atmosphere to construct Broadcaster
 CometSupport getCometSupport()
          Return the current CometSupport
static String getDefaultBroadcasterClassName()
          Return the default Broadcaster class name.
 WebSocketProtocol getWebSocketProtocol()
           
 String getWebSocketProtocolClassName()
           
 void init(javax.servlet.ServletConfig sc)
          Load the AtmosphereHandler associated with this AtmosphereServlet.
protected  void initWebSocketProtocol()
           
protected  boolean isIECandidate(javax.servlet.http.HttpServletRequest request)
           
 boolean isUseStreamForFlushingComments()
          true if Atmosphere uses ServletResponse.getOutputStream() by default for write operation.
protected  void loadAtmosphereDotXml(InputStream stream, URLClassLoader c)
          Load AtmosphereHandler defined under META-INF/atmosphere.xml
protected  void loadAtmosphereHandlersFromPath(URLClassLoader classloader, String realPath)
           
protected  void loadConfiguration(javax.servlet.ServletConfig sc)
           
protected  String lookupDefaultBroadcasterType()
           
protected  void readSystemProperties()
           
 void removeAllAtmosphereHandler()
          Remove all AtmosphereHandler
 void removeAllInitParams()
          Remove all init parameters.
 boolean removeAtmosphereHandler(String mapping)
          Remove an AtmosphereHandler
protected  void sessionSupport(boolean sessionSupport)
           
 void setBroadcasterCacheClassName(String broadcasterCacheClassName)
          Set the BroadcasterCache class name.
 AtmosphereServlet setBroadcasterFactory(BroadcasterFactory broadcasterFactory)
          Set the BroadcasterFactory which is used by Atmosphere to construct Broadcaster
 void setCometSupport(CometSupport cometSupport)
          Set the CometSupport implementation.
static void setDefaultBroadcasterClassName(String bccn)
          Set the default Broadcaster class name
 void setUseStreamForFlushingComments(boolean useStreamForFlushingComments)
          Set to true so Atmosphere uses ServletResponse.getOutputStream() by default for write operation.
 void setWebSocketProtocolClassName(String webSocketProtocolClassName)
           
 
Methods inherited from class weblogic.servlet.http.AbstractAsyncServlet
notify
 
Methods inherited from class org.eclipse.jetty.websocket.WebSocketServlet
checkOrigin, init, service
 
Methods inherited from class javax.servlet.http.HttpServlet
getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.atmosphere.di.ServletContextProvider
getServletContext
 
Methods inherited from interface javax.servlet.Servlet
getServletConfig, getServletInfo, service
 

Field Detail

config

protected final AtmosphereServlet.AtmosphereConfig config

isCometSupportConfigured

protected final AtomicBoolean isCometSupportConfigured

isFilter

protected final boolean isFilter

broadcasterFilters

public static String[] broadcasterFilters

atmosphereHandlers

protected final Map<String,AtmosphereServlet.AtmosphereHandlerWrapper> atmosphereHandlers
The list of AtmosphereHandler and their associated mapping.


useNativeImplementation

protected boolean useNativeImplementation

useBlockingImplementation

protected boolean useBlockingImplementation

useStreamForFlushingComments

protected boolean useStreamForFlushingComments

cometSupport

protected CometSupport cometSupport

broadcasterClassName

protected static String broadcasterClassName

isCometSupportSpecified

protected boolean isCometSupportSpecified

isBroadcasterSpecified

protected boolean isBroadcasterSpecified

isSessionSupportSpecified

protected boolean isSessionSupportSpecified

broadcasterFactoryClassName

protected String broadcasterFactoryClassName

broadcasterCacheClassName

protected static String broadcasterCacheClassName
Constructor Detail

AtmosphereServlet

public AtmosphereServlet()
Create an Atmosphere Servlet.


AtmosphereServlet

public AtmosphereServlet(boolean isFilter)
Create an Atmosphere Servlet.

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

getAtmosphereConfig

public AtmosphereServlet.AtmosphereConfig getAtmosphereConfig()
Return a configured instance of AtmosphereServlet.AtmosphereConfig

Returns:
a configured instance of AtmosphereServlet.AtmosphereConfig

addAtmosphereHandler

public void 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 void 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 void addAtmosphereHandler(String mapping,
                                 AtmosphereHandler<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse> 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 boolean removeAtmosphereHandler(String mapping)
Remove an AtmosphereHandler

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

removeAllAtmosphereHandler

public void removeAllAtmosphereHandler()
Remove all AtmosphereHandler


removeAllInitParams

public void removeAllInitParams()
Remove all init parameters.


addInitParameter

public void 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()

init

public void init(javax.servlet.ServletConfig sc)
          throws javax.servlet.ServletException
Load the AtmosphereHandler associated with this AtmosphereServlet.

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Parameters:
sc - the ServletContext
Throws:
javax.servlet.ServletException

configureWebDotXmlAtmosphereHandler

protected void configureWebDotXmlAtmosphereHandler(javax.servlet.ServletConfig sc)

configureBroadcaster

protected void configureBroadcaster(javax.servlet.ServletContext sc)
                             throws ClassNotFoundException,
                                    InstantiationException,
                                    IllegalAccessException
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException

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

protected 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()

sessionSupport

protected void sessionSupport(boolean sessionSupport)

initWebSocketProtocol

protected void initWebSocketProtocol()

destroy

public void destroy()
Specified by:
destroy in interface javax.servlet.Servlet
Overrides:
destroy in class javax.servlet.GenericServlet

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

setCometSupport

public void setCometSupport(CometSupport cometSupport)
Set the CometSupport implementation. Make sure you don't set an implementation that only works on some Container. See BlockingIOCometSupport for an example.

Parameters:
cometSupport -

getCometSupport

public CometSupport getCometSupport()
Return the current CometSupport

Returns:
the current CometSupport

createCometSupportResolver

protected CometSupportResolver createCometSupportResolver()
Returns an instance of CometSupportResolver CometSupportResolver

Returns:
CometSupportResolver

autoDetectContainer

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


autoDetectAtmosphereHandlers

protected 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

protected void loadAtmosphereHandlersFromPath(URLClassLoader classloader,
                                              String realPath)

doHead

public void doHead(javax.servlet.http.HttpServletRequest req,
                   javax.servlet.http.HttpServletResponse res)
            throws IOException,
                   javax.servlet.ServletException
Delegate the request processing to an instance of CometSupport

Overrides:
doHead in class javax.servlet.http.HttpServlet
Parameters:
req - the HttpServletRequest
res - the HttpServletResponse
Throws:
IOException
javax.servlet.ServletException

doOptions

public void doOptions(javax.servlet.http.HttpServletRequest req,
                      javax.servlet.http.HttpServletResponse res)
               throws IOException,
                      javax.servlet.ServletException
Delegate the request processing to an instance of CometSupport

Overrides:
doOptions in class javax.servlet.http.HttpServlet
Parameters:
req - the HttpServletRequest
res - the HttpServletResponse
Throws:
IOException
javax.servlet.ServletException

doTrace

public void doTrace(javax.servlet.http.HttpServletRequest req,
                    javax.servlet.http.HttpServletResponse res)
             throws IOException,
                    javax.servlet.ServletException
Delegate the request processing to an instance of CometSupport

Overrides:
doTrace in class javax.servlet.http.HttpServlet
Parameters:
req - the HttpServletRequest
res - the HttpServletResponse
Throws:
IOException
javax.servlet.ServletException

doDelete

public void doDelete(javax.servlet.http.HttpServletRequest req,
                     javax.servlet.http.HttpServletResponse res)
              throws IOException,
                     javax.servlet.ServletException
Delegate the request processing to an instance of CometSupport

Overrides:
doDelete in class javax.servlet.http.HttpServlet
Parameters:
req - the HttpServletRequest
res - the HttpServletResponse
Throws:
IOException
javax.servlet.ServletException

doPut

public void doPut(javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse res)
           throws IOException,
                  javax.servlet.ServletException
Delegate the request processing to an instance of CometSupport

Overrides:
doPut in class javax.servlet.http.HttpServlet
Parameters:
req - the HttpServletRequest
res - the HttpServletResponse
Throws:
IOException
javax.servlet.ServletException

doGet

public void doGet(javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse res)
           throws IOException,
                  javax.servlet.ServletException
Delegate the request processing to an instance of CometSupport

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
req - the HttpServletRequest
res - the HttpServletResponse
Throws:
IOException
javax.servlet.ServletException

doPost

public void doPost(javax.servlet.http.HttpServletRequest req,
                   javax.servlet.http.HttpServletResponse res)
            throws IOException,
                   javax.servlet.ServletException
Delegate the request processing to an instance of CometSupport

Overrides:
doPost in class javax.servlet.http.HttpServlet
Parameters:
req - the HttpServletRequest
res - the HttpServletResponse
Throws:
IOException
javax.servlet.ServletException

doCometSupport

public AtmosphereServlet.Action doCometSupport(javax.servlet.http.HttpServletRequest req,
                                               javax.servlet.http.HttpServletResponse res)
                                        throws IOException,
                                               javax.servlet.ServletException
Invoke the proprietary CometSupport

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

event

public void event(CometEvent cometEvent)
           throws IOException,
                  javax.servlet.ServletException
Hack to support Tomcat AIO like other WebServer. This method is invoked by Tomcat when it detect a Servlet implements the interface CometProcessor without invoking Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)

Parameters:
cometEvent - the CometEvent
Throws:
IOException
javax.servlet.ServletException

event

public void event(CometEvent cometEvent)
           throws IOException,
                  javax.servlet.ServletException
Hack to support Tomcat 7 AIO

Specified by:
event in interface CometProcessor
Throws:
IOException
javax.servlet.ServletException

event

public void event(HttpEvent httpEvent)
           throws IOException,
                  javax.servlet.ServletException
Hack to support JBossWeb AIO like other WebServer. This method is invoked by Tomcat when it detect a Servlet implements the interface HttpEventServlet without invoking Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)

Specified by:
event in interface HttpEventServlet
Parameters:
httpEvent - the CometEvent
Throws:
IOException
javax.servlet.ServletException

doRequest

protected boolean doRequest(RequestResponseKey rrk)
                     throws IOException,
                            javax.servlet.ServletException
Weblogic specific comet based implementation.

Specified by:
doRequest in class AbstractAsyncServlet
Parameters:
rrk -
Returns:
true if suspended
Throws:
IOException
javax.servlet.ServletException

doResponse

protected void doResponse(RequestResponseKey rrk,
                          Object context)
                   throws IOException,
                          javax.servlet.ServletException
Weblogic specific comet based implementation.

Specified by:
doResponse in class AbstractAsyncServlet
Parameters:
rrk -
Throws:
IOException
javax.servlet.ServletException

doTimeout

protected void doTimeout(RequestResponseKey rrk)
                  throws IOException,
                         javax.servlet.ServletException
Weblogic specific comet based implementation.

Specified by:
doTimeout in class AbstractAsyncServlet
Parameters:
rrk -
Throws:
IOException
javax.servlet.ServletException

getDefaultBroadcasterClassName

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

Returns:
the broadcasterClassName

setDefaultBroadcasterClassName

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

Parameters:
bccn - the broadcasterClassName to set

isUseStreamForFlushingComments

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

Returns:
the useStreamForFlushingComments

setUseStreamForFlushingComments

public void setUseStreamForFlushingComments(boolean useStreamForFlushingComments)
Set to true so Atmosphere uses ServletResponse.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 AtmosphereServlet setBroadcasterFactory(BroadcasterFactory broadcasterFactory)
                                        throws IllegalAccessException,
                                               InstantiationException,
                                               ClassNotFoundException
Set the BroadcasterFactory which is used by Atmosphere to construct Broadcaster

Returns:
BroadcasterFactory
Throws:
IllegalAccessException
InstantiationException
ClassNotFoundException

getBroadcasterCacheClassName

public String getBroadcasterCacheClassName()
Return the BroadcasterCache class name.

Returns:
the BroadcasterCache class name.

setBroadcasterCacheClassName

public void setBroadcasterCacheClassName(String broadcasterCacheClassName)
                                  throws IllegalAccessException,
                                         InstantiationException,
                                         ClassNotFoundException
Set the BroadcasterCache class name.

Parameters:
broadcasterCacheClassName -
Throws:
IllegalAccessException
InstantiationException
ClassNotFoundException

addBroadcasterType

public void 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 void setWebSocketProtocolClassName(String webSocketProtocolClassName)

configureQueryStringAsRequest

protected Map<String,String> configureQueryStringAsRequest(javax.servlet.http.HttpServletRequest request)

isIECandidate

protected boolean isIECandidate(javax.servlet.http.HttpServletRequest request)

getWebSocketProtocol

public WebSocketProtocol getWebSocketProtocol()

doWebSocketConnect

public WebSocket doWebSocketConnect(javax.servlet.http.HttpServletRequest request,
                                    String protocol)
Jetty 7.2 & 8.0.0-M1/M2and up WebSocket support.

Specified by:
doWebSocketConnect in interface WebSocketFactory.Acceptor
Parameters:
request -
protocol -
Returns:
a WebSocket}


Copyright © 2012. All Rights Reserved.