com.sun.enterprise.web.connector.grizzly.standalone
Class StaticResourcesAdapter

java.lang.Object
  extended by com.sun.enterprise.web.connector.grizzly.standalone.StaticResourcesAdapter
All Implemented Interfaces:
Adapter
Direct Known Subclasses:
CometdAdapter

public class StaticResourcesAdapter
extends Object
implements Adapter

Simple HTTP based Web Server. Part of this class is from Tomcat sandbox code from Costin Manolache.

Author:
Jeanfrancois Arcand

Field Summary
 
Fields inherited from interface org.apache.coyote.Adapter
CONNECTION_PROCESSING_COMPLETED, CONNECTION_PROCESSING_STARTED, REQUEST_PROCESSING_COMPLETED, REQUEST_PROCESSING_STARTED
 
Constructor Summary
StaticResourcesAdapter()
           
 
Method Summary
 void afterService(Request req, Response res)
          Finish the response and recycle the request/response tokens.
 void fireAdapterEvent(String string, Object object)
          Notify all container event listeners that a particular event has occurred for this Adapter.
 String getContentType(String ext)
           
 String getRootFolder()
           
 void service(Request req, Response res)
          Call the service method, and notify all listeners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaticResourcesAdapter

public StaticResourcesAdapter()
Method Detail

service

public void service(Request req,
                    Response res)
             throws Exception
Description copied from interface: Adapter
Call the service method, and notify all listeners

Specified by:
service in interface Adapter
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 )

getContentType

public String getContentType(String ext)

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
Throws:
Exception

fireAdapterEvent

public void fireAdapterEvent(String string,
                             Object object)
Description copied from interface: Adapter
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.

Specified by:
fireAdapterEvent in interface Adapter
Parameters:
string - Event type
object - Event data

getRootFolder

public String getRootFolder()


Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.