com.sun.grizzly.container
Class GrizzletAdapter
java.lang.Object
com.sun.grizzly.tcp.StaticResourcesAdapter
com.sun.grizzly.container.GrizzletAdapter
- All Implemented Interfaces:
- Adapter
public class GrizzletAdapter
- extends StaticResourcesAdapter
- implements Adapter
Standalone Comet implementation. This class is used when Comet is enabled
from the Grizzly standalone WebServer. This class is responsible for invoking
the Grizzlet defined when starting the Grizzly WebServer.
- Author:
- Jeanfrancois Arcand
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ADAPTER_NOTES
public static final int ADAPTER_NOTES
- See Also:
- Constant Field Values
POST
public static final int POST
- See Also:
- Constant Field Values
GRIZZLET
public static final int GRIZZLET
- See Also:
- Constant Field Values
GrizzletAdapter
public GrizzletAdapter()
GrizzletAdapter
public GrizzletAdapter(String cometContextName)
service
public void service(Request req,
Response res)
throws Exception
- Route the request to the comet 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 )
afterService
public void afterService(Request req,
Response res)
throws Exception
- Description copied from interface:
Adapter
- Finish the response and recycle the request/response tokens. Base on
the connection header, the underlying socket transport will be closed
- Specified by:
afterService
in interface Adapter
- Overrides:
afterService
in class StaticResourcesAdapter
- Throws:
Exception
getGrizzlet
public Grizzlet getGrizzlet()
- Set the user defined
Grizzlet
implementation.
setGrizzlet
public void setGrizzlet(Grizzlet grizzlet)
- Return the user defined
Grizzlet
implementation.
getCometContextName
public String getCometContextName()
setCometContextName
public void setCometContextName(String cometContextName)
Copyright © 2010 SUN Microsystems. All Rights Reserved.