org.cometd.server.transport
Class JSONTransport

java.lang.Object
  extended by org.cometd.server.AbstractServerTransport
      extended by org.cometd.server.transport.HttpTransport
          extended by org.cometd.server.transport.LongPollingTransport
              extended by org.cometd.server.transport.JSONTransport
All Implemented Interfaces:
ServerTransport, Transport

public class JSONTransport
extends LongPollingTransport


Nested Class Summary
 
Nested classes/interfaces inherited from class org.cometd.server.AbstractServerTransport
AbstractServerTransport.OneTimeScheduler, AbstractServerTransport.Scheduler
 
Field Summary
static String MIME_TYPE_OPTION
           
static String NAME
           
static String PREFIX
           
 
Fields inherited from class org.cometd.server.transport.LongPollingTransport
ALLOW_MULTI_SESSIONS_NO_BROWSER_OPTION, AUTOBATCH_OPTION, BROWSER_ID_OPTION, MAX_SESSIONS_PER_BROWSER_OPTION, MULTI_SESSION_INTERVAL_OPTION
 
Fields inherited from class org.cometd.server.transport.HttpTransport
JSON_DEBUG_OPTION, MESSAGE_PARAM
 
Fields inherited from class org.cometd.server.AbstractServerTransport
INTERVAL_OPTION, MAX_INTERVAL_OPTION, MAX_LAZY_OPTION, META_CONNECT_DELIVERY_OPTION, TIMEOUT_OPTION
 
Constructor Summary
JSONTransport(BayeuxServerImpl bayeux)
           
 
Method Summary
 boolean accept(javax.servlet.http.HttpServletRequest request)
           
protected  void complete(PrintWriter writer)
           
protected  void init()
          Initialise the transport.
protected  boolean isAlwaysFlushingAfterHandle()
           
protected  PrintWriter send(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, PrintWriter writer, ServerMessage message)
           
 
Methods inherited from class org.cometd.server.transport.LongPollingTransport
decBrowserId, doSweep, findBrowserId, handle, handleJSONParseException, incBrowserId, metaConnectResumed, metaConnectSuspended, setBrowserId
 
Methods inherited from class org.cometd.server.transport.HttpTransport
getContext, getCurrentLocalAddress, getCurrentRemoteAddress, getCurrentRequest, parseMessages, setCurrentRequest
 
Methods inherited from class org.cometd.server.AbstractServerTransport
getAdvice, getBayeux, getInterval, getMaxInterval, getMaxLazyTimeout, getName, getOption, getOption, getOption, getOption, getOption, getOptionNames, getOptionPrefix, getTimeout, isMetaConnectDeliveryOnly, setAdvice, setInterval, setMaxInterval, setMaxLazyTimeout, setMetaConnectDeliveryOnly, setOption, setOptionPrefix, setTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREFIX

public static final String PREFIX
See Also:
Constant Field Values

NAME

public static final String NAME
See Also:
Constant Field Values

MIME_TYPE_OPTION

public static final String MIME_TYPE_OPTION
See Also:
Constant Field Values
Constructor Detail

JSONTransport

public JSONTransport(BayeuxServerImpl bayeux)
Method Detail

isAlwaysFlushingAfterHandle

protected boolean isAlwaysFlushingAfterHandle()
Specified by:
isAlwaysFlushingAfterHandle in class LongPollingTransport
Returns:
true if the transport always flushes at the end of a call to LongPollingTransport.handle(HttpServletRequest, HttpServletResponse).

init

protected void init()
Description copied from class: AbstractServerTransport
Initialise the transport. Initialise the transport, resolving default and direct options. After the call to init, the #getMutableOptions() set should be reset to reflect only the options that can be changed on a running transport. This implementation clears the mutable options set.

Overrides:
init in class LongPollingTransport

accept

public boolean accept(javax.servlet.http.HttpServletRequest request)
Specified by:
accept in class HttpTransport

send

protected PrintWriter send(javax.servlet.http.HttpServletRequest request,
                           javax.servlet.http.HttpServletResponse response,
                           PrintWriter writer,
                           ServerMessage message)
                    throws IOException
Specified by:
send in class LongPollingTransport
Throws:
IOException

complete

protected void complete(PrintWriter writer)
                 throws IOException
Specified by:
complete in class LongPollingTransport
Throws:
IOException


Copyright © 2008-2011 Dojo Foundation. All Rights Reserved.