com.sun.grizzly.tcp
Interface Adapter

All Known Implementing Classes:
CometdAdapter, DynamicContentAdapter, DynamicContentAdapter, GrizzletAdapter, GrizzlyAdapter, RailsAdapter, ServletAdapter, StaticResourcesAdapter, StaticResourcesAdapter

public interface Adapter

Adapter. This represents the entry point to a coyote-based servlet container.

Author:
Remy Maucherat

Field Summary
static String CONNECTION_PROCESSING_COMPLETED
           
static String CONNECTION_PROCESSING_STARTED
           
static String REQUEST_PROCESSING_COMPLETED
           
static String REQUEST_PROCESSING_STARTED
           
 
Method Summary
 void afterService(Request req, Response res)
          Finish the response and recycle the request/response tokens.
 void fireAdapterEvent(String type, Object data)
          Notify all container event listeners that a particular event has occurred for this Adapter.
 void service(Request req, Response res)
          Call the service method, and notify all listeners
 

Field Detail

CONNECTION_PROCESSING_STARTED

static final String CONNECTION_PROCESSING_STARTED
See Also:
Constant Field Values

CONNECTION_PROCESSING_COMPLETED

static final String CONNECTION_PROCESSING_COMPLETED
See Also:
Constant Field Values

REQUEST_PROCESSING_STARTED

static final String REQUEST_PROCESSING_STARTED
See Also:
Constant Field Values

REQUEST_PROCESSING_COMPLETED

static final String REQUEST_PROCESSING_COMPLETED
See Also:
Constant Field Values
Method Detail

service

void service(Request req,
             Response res)
             throws Exception
Call the service method, and notify all listeners

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

void afterService(Request req,
                  Response res)
                  throws Exception
Finish the response and recycle the request/response tokens. Base on the connection header, the underlying socket transport will be closed

Throws:
Exception

fireAdapterEvent

void fireAdapterEvent(String type,
                      Object data)
Notify all container event listeners that a particular event has occurred for this Adapter. The default implementation performs this notification synchronously using the calling thread.

Parameters:
type - Event type
data - Event data


Copyright © 2008 SUN Microsystems. All Rights Reserved.