Package org.apache.catalina.connector
Class CoyoteAdapter
- java.lang.Object
-
- org.glassfish.grizzly.http.server.HttpHandler
-
- org.apache.catalina.connector.CoyoteAdapter
-
public class CoyoteAdapter extends org.glassfish.grizzly.http.server.HttpHandlerImplementation of a request processor which delegates the processing to a Coyote processor.- Version:
- $Revision: 1.34 $ $Date: 2007/08/24 18:38:28 $
- Author:
- Craig R. McClanahan, Remy Maucherat
-
-
Field Summary
Fields Modifier and Type Field Description protected static booleanALLOW_BACKSLASHprotected static org.glassfish.grizzly.http.Note<org.glassfish.grizzly.http.server.util.MappingData>MAPPING_DATA
-
Constructor Summary
Constructors Constructor Description CoyoteAdapter(Connector connector)Construct a new CoyoteProcessor associated with the specified connector.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static voidcopyBytes(byte[] b, int dest, int src, int len)Copy an array of bytes to a different position.voidfireAdapterEvent(String type, Object data)Notify all container event listeners that a particular event has occurred for this Adapter.intgetPort()Gets the port of this CoyoteAdapter.booleanisCompatWithTomcat()Return true when an instance is executed the same way it does in Tomcat.protected voidlog(String message)Log a message on the Logger associated with our Container (if any)protected voidlog(String message, Throwable throwable)Log a message on the Logger associated with our Container (if any)static booleannormalize(org.glassfish.grizzly.http.util.DataChunk uriDC, Response response)Normalize URI.protected booleanpostParseRequest(org.glassfish.grizzly.http.server.Request req, Request request, org.glassfish.grizzly.http.server.Response res, Response response, boolean v3Enabled)Parse additional request parameters.voidservice(org.glassfish.grizzly.http.server.Request req, org.glassfish.grizzly.http.server.Response res)Service method.voidsetCompatWithTomcat(boolean compatWithTomcat)true if this class needs to be compatible with Tomcat Adapter class.-
Methods inherited from class org.glassfish.grizzly.http.server.HttpHandler
destroy, getErrorPageGenerator, getName, getRequestExecutorProvider, getRequestURIEncoding, getSessionCookieName, getSessionManager, isAllowCustomStatusMessage, isAllowEncodedSlash, sendAcknowledgment, setAllowCustomStatusMessage, setAllowEncodedSlash, setDecodeUrl, setDispatcherHelper, setRequestURIEncoding, setRequestURIEncoding, start, updatePaths
-
-
-
-
Constructor Detail
-
CoyoteAdapter
public CoyoteAdapter(Connector connector)
Construct a new CoyoteProcessor associated with the specified connector.- Parameters:
connector- CoyoteConnector that owns this processor
-
-
Method Detail
-
service
public void service(org.glassfish.grizzly.http.server.Request req, org.glassfish.grizzly.http.server.Response res) throws ExceptionService method.- Specified by:
servicein classorg.glassfish.grizzly.http.server.HttpHandler- Throws:
Exception
-
postParseRequest
protected boolean postParseRequest(org.glassfish.grizzly.http.server.Request req, Request request, org.glassfish.grizzly.http.server.Response res, Response response, boolean v3Enabled) throws ExceptionParse additional request parameters.- Throws:
Exception
-
normalize
public static boolean normalize(org.glassfish.grizzly.http.util.DataChunk uriDC, Response response)Normalize URI.This method normalizes "\", "//", "/./" and "/../". This method will throw an error when trying to go above the root, or if the URI contains a null byte.
- Parameters:
uriDC- URI DataChunk to be normalizedresponse- The Catalina Response that a detail error message will be added to if an error is encountered
-
copyBytes
protected static void copyBytes(byte[] b, int dest, int src, int len)Copy an array of bytes to a different position. Used during normalization.
-
log
protected void log(String message)
Log a message on the Logger associated with our Container (if any)- Parameters:
message- Message to be logged
-
log
protected void log(String message, Throwable throwable)
Log a message on the Logger associated with our Container (if any)- Parameters:
message- Message to be loggedthrowable- Associated exception
-
fireAdapterEvent
public 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 typedata- Event data
-
isCompatWithTomcat
public boolean isCompatWithTomcat()
Return true when an instance is executed the same way it does in Tomcat.
-
setCompatWithTomcat
public void setCompatWithTomcat(boolean compatWithTomcat)
true if this class needs to be compatible with Tomcat Adapter class. Since Tomcat Adapter implementation doesn't support the afterService method, the afterService method must be invoked inside the service method.
-
getPort
public int getPort()
Gets the port of this CoyoteAdapter.- Returns:
- the port of this CoyoteAdapter
-
-