Errai 3.0.1-SNAPSHOT

org.jboss.errai.bus.server.servlet
Class AbstractErraiServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.jboss.errai.bus.server.servlet.AbstractErraiServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
DefaultBlockingServlet, JettyContinuationsServlet, StandardAsyncServlet

public abstract class AbstractErraiServlet
extends javax.servlet.http.HttpServlet

The AbstractErraiServlet provides a starting point for creating Http-protocol gateway between the server bus and the client buses.

See Also:
Serialized Form

Nested Class Summary
static class AbstractErraiServlet.ConnectionPhase
           
 
Field Summary
protected  ErraiService service
           
protected  SessionProvider<javax.servlet.http.HttpSession> sessionProvider
           
protected  byte[] SSE_TERMINATION_BYTES
           
 
Constructor Summary
AbstractErraiServlet()
           
 
Method Summary
 void destroy()
           
protected static String getClientId(javax.servlet.http.HttpServletRequest request)
           
static AbstractErraiServlet.ConnectionPhase getConnectionPhase(javax.servlet.http.HttpServletRequest request)
           
protected  int getLongPollTimeout()
           
protected  int getSSETimeout()
           
 void init(javax.servlet.ServletConfig config)
           
 void initAsFilter(javax.servlet.FilterConfig config)
           
 boolean isLongPollingEnabled()
           
protected  boolean isSSERequest(javax.servlet.http.HttpServletRequest request)
           
protected  void prepareCometPoll(javax.servlet.http.HttpServletResponse response)
           
protected  void prepareSSE(javax.servlet.http.HttpServletResponse response)
           
protected  void prepareSSEContinue(javax.servlet.http.HttpServletResponse response)
           
protected  void sendDisconnectDueToSessionExpiry(javax.servlet.http.HttpServletResponse response)
           
protected  void sendDisconnectWithReason(OutputStream stream, String reason)
           
protected  boolean shouldWait(javax.servlet.http.HttpServletRequest request)
           
protected  void writeExceptionToOutputStream(javax.servlet.http.HttpServletResponse httpServletResponse, Throwable t)
           
static void writeToOutputStream(OutputStream stream, String encodedMessage)
          Writes the message to the output stream
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SSE_TERMINATION_BYTES

protected final byte[] SSE_TERMINATION_BYTES

service

protected ErraiService service

sessionProvider

protected SessionProvider<javax.servlet.http.HttpSession> sessionProvider
Constructor Detail

AbstractErraiServlet

public AbstractErraiServlet()
Method Detail

getConnectionPhase

public static AbstractErraiServlet.ConnectionPhase getConnectionPhase(javax.servlet.http.HttpServletRequest request)

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException

initAsFilter

public void initAsFilter(javax.servlet.FilterConfig config)
                  throws javax.servlet.ServletException
Throws:
javax.servlet.ServletException

destroy

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

writeToOutputStream

public static void writeToOutputStream(OutputStream stream,
                                       String encodedMessage)
                                throws IOException
Writes the message to the output stream

Parameters:
stream - - the stream to write to
encodedMessage - - the message to write to the stream
Throws:
IOException - - is thrown if any input/output errors occur while writing to the stream

writeExceptionToOutputStream

protected void writeExceptionToOutputStream(javax.servlet.http.HttpServletResponse httpServletResponse,
                                            Throwable t)
                                     throws IOException
Throws:
IOException

sendDisconnectWithReason

protected void sendDisconnectWithReason(OutputStream stream,
                                        String reason)
                                 throws IOException
Throws:
IOException

sendDisconnectDueToSessionExpiry

protected void sendDisconnectDueToSessionExpiry(javax.servlet.http.HttpServletResponse response)
                                         throws IOException
Throws:
IOException

getClientId

protected static String getClientId(javax.servlet.http.HttpServletRequest request)

getLongPollTimeout

protected int getLongPollTimeout()

getSSETimeout

protected final int getSSETimeout()

isLongPollingEnabled

public boolean isLongPollingEnabled()

shouldWait

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

isSSERequest

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

prepareCometPoll

protected void prepareCometPoll(javax.servlet.http.HttpServletResponse response)

prepareSSE

protected void prepareSSE(javax.servlet.http.HttpServletResponse response)
                   throws IOException
Throws:
IOException

prepareSSEContinue

protected void prepareSSEContinue(javax.servlet.http.HttpServletResponse response)
                           throws IOException
Throws:
IOException

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.