com.sun.grizzly.cometd.standalone
Class CometdAdapter

java.lang.Object
  extended by com.sun.grizzly.tcp.StaticResourcesAdapter
      extended by com.sun.grizzly.cometd.standalone.CometdAdapter
All Implemented Interfaces:
Adapter

public class CometdAdapter
extends StaticResourcesAdapter
implements Adapter

Standalone Cometd implementation. This class is used when Cometd is enabled from the Grizzly standalone WebServer. To enable it, just add: -Dcom.sun.grizzly.adapterClass=com.sun.grizzly.cometd.standalone.CometdAdapter

Author:
Jeanfrancois Arcand

Field Summary
static int ADAPTER_NOTES
           
 
Fields inherited from class com.sun.grizzly.tcp.StaticResourcesAdapter
commitErrorResponse, logger
 
Fields inherited from interface com.sun.grizzly.tcp.Adapter
CONNECTION_PROCESSING_COMPLETED, CONNECTION_PROCESSING_STARTED, REQUEST_PROCESSING_COMPLETED, REQUEST_PROCESSING_STARTED
 
Constructor Summary
CometdAdapter()
           
 
Method Summary
 String getContextPath()
          Return the comet context path used by this Adapter.
 void service(Request req, Response res)
          Route the request to the cometd implementation.
 void setContextPath(String contextPath)
          Set the comet context path.
 
Methods inherited from class com.sun.grizzly.tcp.StaticResourcesAdapter
afterService, customizedErrorPage, fireAdapterEvent, getLogger, getRootFolder, service, setLogger, setRootFolder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.grizzly.tcp.Adapter
afterService, fireAdapterEvent
 

Field Detail

ADAPTER_NOTES

public static final int ADAPTER_NOTES
See Also:
Constant Field Values
Constructor Detail

CometdAdapter

public CometdAdapter()
Method Detail

service

public void service(Request req,
                    Response res)
             throws Exception
Route the request to the cometd implementation. If the request point to a static file, delegate the call to the Grizzly WebServer implementation.

Specified by:
service in interface Adapter
Overrides:
service in class StaticResourcesAdapter
Throws:
Exception - if an error happens during handling of the request. Common errors are:
  • IOException if an input/output error occurs and we are processing an included servlet (otherwise it is swallowed and handled by the top level error handler mechanism)
  • ServletException if a servlet throws an exception and we are processing an included servlet (otherwise it is swallowed and handled by the top level error handler mechanism)
Tomcat should be able to handle and log any other exception ( including runtime exceptions )

getContextPath

public String getContextPath()
Return the comet context path used by this Adapter. By default, it return "/cometd"


setContextPath

public void setContextPath(String contextPath)
Set the comet context path.



Copyright © 2011 SUN Microsystems. All Rights Reserved.