Class CoyoteAdapter
java.lang.Object
org.apache.catalina.connector.CoyoteAdapter
- All Implemented Interfaces:
Adapter
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprotected static final StringManagerThe string manager for this package. -
Constructor Summary
ConstructorsConstructorDescriptionCoyoteAdapter(Connector connector) Construct a new CoyoteProcessor associated with the specified connector. -
Method Summary
Modifier and TypeMethodDescriptionbooleanasyncDispatch(Request req, Response res, SocketEvent status) Dispatch asynchronous event.voidcheckRecycled(Request req, Response res) Assert that request and response have been recycled.protected voidCharacter conversion of the US-ASCII MessageBytes.protected voidconvertURI(MessageBytes uri, Request request) Character conversion of the URI.protected static voidcopyBytes(byte[] b, int dest, int src, int len) Copy an array of bytes to a different position.Provide the name of the domain to use to register MBeans for components associated with the connector.voidCallback to allow logging access outside of the execution of the regular service.static booleannormalize(MessageBytes uriMB, boolean allowBackslash) This method normalizes "\", "//", "/./" and "/../".protected voidparsePathParameters(Request req, Request request) Extract the path parameters from the request.protected voidparseSessionCookiesId(Request request) Parse session id in Cookie.protected voidparseSessionSslId(Request request) Look for SSL session ID if required.protected booleanpostParseRequest(Request req, Request request, Response res, Response response) Perform the necessary processing after the HTTP headers have been parsed to enable the request/response pair to be passed to the start of the container pipeline for processing.booleanPrepare the given request/response for processing.voidCall the service method, and notify all listeners.
-
Field Details
-
ADAPTER_NOTES
public static final int ADAPTER_NOTES- See Also:
-
sm
The string manager for this package.
-
-
Constructor Details
-
CoyoteAdapter
Construct a new CoyoteProcessor associated with the specified connector.- Parameters:
connector- CoyoteConnector that owns this processor
-
-
Method Details
-
asyncDispatch
Description copied from interface:AdapterDispatch asynchronous event.- Specified by:
asyncDispatchin interfaceAdapter- Parameters:
req- the request objectres- the response objectstatus- the event being processed- Returns:
trueif the dispatch was successful- Throws:
Exception- If the processing fails unexpectedly
-
service
Description copied from interface:AdapterCall the service method, and notify all listeners.- Specified by:
servicein interfaceAdapter- Parameters:
req- The request objectres- The response object- 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)
-
prepare
Description copied from interface:AdapterPrepare the given request/response for processing. This method requires that the request object has been populated with the information available from the HTTP headers.- Specified by:
preparein interfaceAdapter- Parameters:
req- The request objectres- The response object- Returns:
trueif processing can continue, otherwisefalsein which case an appropriate error will have been set on the response- Throws:
IOExceptionServletException
-
log
Description copied from interface:AdapterCallback to allow logging access outside of the execution of the regular service. -
checkRecycled
Description copied from interface:AdapterAssert that request and response have been recycled. If they have not then log a warning and force a recycle. This method is called as a safety check when a processor is being recycled and may be returned to a pool for reuse.- Specified by:
checkRecycledin interfaceAdapter- Parameters:
req- Requestres- Response
-
getDomain
-
postParseRequest
protected boolean postParseRequest(Request req, Request request, Response res, Response response) throws IOException, ServletException Perform the necessary processing after the HTTP headers have been parsed to enable the request/response pair to be passed to the start of the container pipeline for processing.- Parameters:
req- The coyote request objectrequest- The catalina request objectres- The coyote response objectresponse- The catalina response object- Returns:
trueif the request should be passed on to the start of the container pipeline, otherwisefalse- Throws:
IOException- If there is insufficient space in a buffer while processing headersServletException- If the supported methods of the target servlet cannot be determined
-
parsePathParameters
Extract the path parameters from the request. This assumes parameters are of the form /path;name=value;name2=value2/ etc. Currently only really interested in the session ID that will be in this form. Other parameters can safely be ignored.- Parameters:
req- The Coyote request objectrequest- The Servlet request object
-
parseSessionSslId
Look for SSL session ID if required. Only look for SSL Session ID if it is the only tracking method enabled.- Parameters:
request- The Servlet request object
-
parseSessionCookiesId
Parse session id in Cookie.- Parameters:
request- The Servlet request object
-
convertURI
Character conversion of the URI.- Parameters:
uri- MessageBytes object containing the URIrequest- The Servlet request object- Throws:
IOException- if a IO exception occurs sending an error to the client
-
convertMB
Character conversion of the US-ASCII MessageBytes.- Parameters:
mb- The MessageBytes instance containing the bytes that should be converted to chars
-
normalize
This method normalizes "\", "//", "/./" and "/../".- Parameters:
uriMB- URI to be normalizedallowBackslash-trueif backslash characters are allowed in URLs- Returns:
falseif normalizing this URI would require going above the root, or if the URI contains a null byte, otherwisetrue
-
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.- Parameters:
b- The bytes that should be copieddest- Destination offsetsrc- Source offsetlen- Length
-