this.code=code;
}
- /** Action id, useable in switches and table indexes
+ /** Action id, usable in switches and table indexes
*/
public int getCode() {
return code;
* Processor is single threaded and specific to stream-based protocols,
* will not fit Jk protocols like JNI.
*
- * This is the main interface to be implemented by a coyoute connector.
- * Adapter is the main interface to be impleneted by a coyote servlet container.
+ * This is the main interface to be implemented by a coyote connector.
+ * Adapter is the main interface to be implemented by a coyote servlet container.
*
* @author Remy Maucherat
* @author Costin Manolache
private ActionHook hook;
private int bytesRead=0;
- // Time of the request - usefull to avoid repeated calls to System.currentTime
+ // Time of the request - useful to avoid repeated calls to System.currentTime
private long startTime = 0L;
private int available = 0;
/**
- * Get the instance id (or JVM route). Curently Ajp is sending it with each
+ * Get the instance id (or JVM route). Currently Ajp is sending it with each
* request. In future this should be fixed, and sent only once ( or
- * 'negociated' at config time so both tomcat and apache share the same name.
+ * 'negotiated' at config time so both tomcat and apache share the same name.
*
* @return the instance id
*/
import java.util.ArrayList;
/** This can be moved to top level ( eventually with a better name ).
- * It is currently used only as a JMX artifact, to agregate the data
+ * It is currently used only as a JMX artifact, to aggregate the data
* collected from each RequestProcessor thread.
*/
public class RequestGroupInfo {
/**
* Structure holding the Request and Response objects. It also holds statistical
* informations about request processing and provide management informations
- * about the requests beeing processed.
+ * about the requests being processed.
*
* Each thread uses a Request/Response pair that is recycled on each request.
* This object provides a place to collect global low-level statistics - without
ObjectName rpName;
// -------------------- Information about the current request -----------
- // This is usefull for long-running requests only
+ // This is useful for long-running requests only
public String getMethod() {
return req.method().toString();
}
/**
- * Called explicitely by user to set the Content-Language and
+ * Called explicitly by user to set the Content-Language and
* the default encoding
*/
public void setLocale(Locale locale) {
* of the response. This method must be called prior to writing output
* using getWriter().
*
- * @param charset String containing the name of the chararacter encoding.
+ * @param charset String containing the name of the character encoding.
*/
public void setCharacterEncoding(String charset) {
}
int len = chunk.getLength();
- // 4 - hardcoded, byte[] marshalling overhead
+ // 4 - hardcoded, byte[] marshaling overhead
// Adjust allowed size if packetSize != default (Constants.MAX_PACKET_SIZE)
int chunkSize = Constants.MAX_SEND_SIZE + packetSize - Constants.MAX_PACKET_SIZE;
int off = 0;
/**
- * Adapter which will process the requests recieved by this endpoint.
+ * Adapter which will process the requests received by this endpoint.
*/
private Adapter adapter;
}
int len = chunk.getLength();
- // 4 - hardcoded, byte[] marshalling overhead
+ // 4 - hardcoded, byte[] marshaling overhead
// Adjust allowed size if packetSize != default (Constants.MAX_PACKET_SIZE)
int chunkSize = Constants.MAX_SEND_SIZE + packetSize - Constants.MAX_PACKET_SIZE;
int off = 0;
/**
- * Adapter which will process the requests recieved by this endpoint.
+ * Adapter which will process the requests received by this endpoint.
*/
private Adapter adapter;
/**
- * Content delimitator for the request (if false, the connection will
+ * Content delimiter for the request (if false, the connection will
* be closed at the end of the request).
*/
protected boolean contentDelimitation = true;
/**
- * Minimum contentsize to make compression.
+ * Minimum content size to make compression.
*/
protected int compressionMinSize = 2048;
}
/**
- * Add a mime-type which will be compressable
+ * Add a mime-type which will be compressible
* The mime-type String will be exactly matched
* in the response mime-type header .
*
/**
- * Set compressable mime-type list (this method is best when used with
+ * Set compressible mime-type list (this method is best when used with
* a large number of connectors, where it would be better to have all of
* them referenced a single array).
*/
|| (acceptEncodingMB.indexOf("gzip") == -1))
return false;
- // Check if content is not allready gzipped
+ // Check if content is not already gzipped
MessageBytes contentEncodingMB =
response.getMimeHeaders().getValue("Content-Encoding");
&& (contentEncodingMB.indexOf("gzip") != -1))
return false;
- // If force mode, allways compress (test purposes only)
+ // If force mode, always compress (test purposes only)
if (compressionLevel == 2)
return true;
}
}
- // Check if suffisant len to trig the compression
+ // Check if sufficient length to trigger the compression
long contentLength = response.getContentLengthLong();
if ((contentLength == -1)
|| (contentLength > compressionMinSize)) {
/**
* End request (consumes leftover bytes).
*
- * @throws IOException an undelying I/O error occured
+ * @throws IOException an underlying I/O error occurred
*/
public void endRequest()
throws IOException {
*
* @param chunk byte chunk
* @return number of bytes written
- * @throws IOException an undelying I/O error occured
+ * @throws IOException an underlying I/O error occurred
*/
public int doWrite(ByteChunk chunk, Response res)
throws IOException {
/**
* Flush the response.
*
- * @throws IOException an undelying I/O error occured
+ * @throws IOException an underlying I/O error occurred
*/
public void flush()
throws IOException {
/**
* End request.
*
- * @throws IOException an undelying I/O error occured
+ * @throws IOException an underlying I/O error occurred
*/
public void endRequest()
throws IOException {
/**
- * This method will write the contents of the specyfied message bytes
+ * This method will write the contents of the specified message bytes
* buffer to the output stream, without filtering. This method is meant to
* be used to write the response header.
*
/**
- * This method will write the contents of the specyfied message bytes
+ * This method will write the contents of the specified message bytes
* buffer to the output stream, without filtering. This method is meant to
* be used to write the response header.
*
/**
- * This method will write the contents of the specyfied char
+ * This method will write the contents of the specified char
* buffer to the output stream, without filtering. This method is meant to
* be used to write the response header.
*
/**
- * This method will write the contents of the specyfied byte
+ * This method will write the contents of the specified byte
* buffer to the output stream, without filtering. This method is meant to
* be used to write the response header.
*
/**
- * This method will write the contents of the specyfied String to the
+ * This method will write the contents of the specified String to the
* output stream, without filtering. This method is meant to be used to
* write the response header.
*
/**
- * Content delimitator for the request (if false, the connection will
+ * Content delimiter for the request (if false, the connection will
* be closed at the end of the request).
*/
protected boolean contentDelimitation = true;
/**
- * Minimum contentsize to make compression.
+ * Minimum content size to make compression.
*/
protected int compressionMinSize = 2048;
}
/**
- * Add a mime-type which will be compressable
+ * Add a mime-type which will be compressible
* The mime-type String will be exactly matched
* in the response mime-type header .
*
/**
- * Set compressable mime-type list (this method is best when used with
+ * Set compressible mime-type list (this method is best when used with
* a large number of connectors, where it would be better to have all of
* them referenced a single array).
*/
/**
- * Set compressable mime-type list
+ * Set compressible mime-type list
* List contains users agents separated by ',' :
*
* ie: "text/html,text/xml,text/plain"
} else if (actionCode == ActionCode.ACTION_ACK) {
- // Acknowlege request
+ // Acknowledge request
// Send a 100 status back if it makes sense (response not committed
// yet, and client specified an expectation for 100-continue)
if (valueMB == null || valueMB.isNull()) {
// HTTP/1.0
- // Default is what the socket tells us. Overriden if a host is
+ // Default is what the socket tells us. Overridden if a host is
// found/parsed
request.setServerPort(endpoint.getPort());
return;
|| (acceptEncodingMB.indexOf("gzip") == -1))
return false;
- // Check if content is not allready gzipped
+ // Check if content is not already gzipped
MessageBytes contentEncodingMB =
response.getMimeHeaders().getValue("Content-Encoding");
&& (contentEncodingMB.indexOf("gzip") != -1))
return false;
- // If force mode, allways compress (test purposes only)
+ // If force mode, always compress (test purposes only)
if (compressionLevel == 2)
return true;
}
}
- // Check if suffisant len to trig the compression
+ // Check if sufficient length to trigger the compression
long contentLength = response.getContentLengthLong();
if ((contentLength == -1)
|| (contentLength > compressionMinSize)) {
} else if (actionCode == ActionCode.ACTION_ACK) {
- // Acknowlege request
+ // Acknowledge request
// Send a 100 status back if it makes sense (response not committed
// yet, and client specified an expectation for 100-continue)
if (valueMB == null || valueMB.isNull()) {
// HTTP/1.0
- // Default is what the socket tells us. Overriden if a host is
+ // Default is what the socket tells us. Overridden if a host is
// found/parsed
request.setServerPort(endpoint.getPort());
return;
} else if (actionCode == ActionCode.ACTION_ACK) {
- // Acknowlege request
+ // Acknowledge request
// Send a 100 status back if it makes sense (response not committed
// yet, and client specified an expectation for 100-continue)
if (valueMB == null || valueMB.isNull()) {
// HTTP/1.0
- // Default is what the socket tells us. Overriden if a host is
+ // Default is what the socket tells us. Overridden if a host is
// found/parsed
request.setServerPort(socket.getLocalPort());
InetAddress localAddress = socket.getLocalAddress();
/**
* End request (consumes leftover bytes).
*
- * @throws IOException an undelying I/O error occured
+ * @throws IOException an underlying I/O error occurred
*/
public void endRequest()
throws IOException {
* using it.
*
* @throws IOException If an exception occurs during the underlying socket
- * read operations, or if the given buffer is not big enough to accomodate
+ * read operations, or if the given buffer is not big enough to accommodate
* the whole line.
* @return true if data is properly fed; false if no data is available
* immediately and thread should be freed
/**
- * Fill the internal buffer using data from the undelying input stream.
+ * Fill the internal buffer using data from the underlying input stream.
*
* @return false if at end of stream
*/
/**
* Flush the response.
*
- * @throws IOException an undelying I/O error occured
+ * @throws IOException an underlying I/O error occurred
*/
public void flush()
throws IOException {
/**
* End request.
*
- * @throws IOException an undelying I/O error occured
+ * @throws IOException an underlying I/O error occurred
*/
public void endRequest()
throws IOException {
/**
- * Send an acknoledgement.
+ * Send an acknowledgment.
*/
public void sendAck()
throws IOException {
*
* @param chunk byte chunk
* @return number of bytes written
- * @throws IOException an undelying I/O error occured
+ * @throws IOException an underlying I/O error occurred
*/
public int doWrite(ByteChunk chunk, Response res)
throws IOException {
/**
* Commit the response.
*
- * @throws IOException an undelying I/O error occured
+ * @throws IOException an underlying I/O error occurred
*/
protected void commit()
throws IOException {
/**
- * This method will write the contents of the specyfied message bytes
+ * This method will write the contents of the specified message bytes
* buffer to the output stream, without filtering. This method is meant to
* be used to write the response header.
*
/**
- * This method will write the contents of the specyfied message bytes
+ * This method will write the contents of the specified message bytes
* buffer to the output stream, without filtering. This method is meant to
* be used to write the response header.
*
/**
- * This method will write the contents of the specyfied char
+ * This method will write the contents of the specified char
* buffer to the output stream, without filtering. This method is meant to
* be used to write the response header.
*
/**
- * This method will write the contents of the specyfied byte
+ * This method will write the contents of the specified byte
* buffer to the output stream, without filtering. This method is meant to
* be used to write the response header.
*
/**
- * This method will write the contents of the specyfied String to the
+ * This method will write the contents of the specified String to the
* output stream, without filtering. This method is meant to be used to
* write the response header.
*
* using it.
*
* @throws IOException If an exception occurs during the underlying socket
- * read operations, or if the given buffer is not big enough to accomodate
+ * read operations, or if the given buffer is not big enough to accommodate
* the whole line.
*/
@Override
* using it.
*
* @throws IOException If an exception occurs during the underlying socket
- * read operations, or if the given buffer is not big enough to accomodate
+ * read operations, or if the given buffer is not big enough to accommodate
* the whole line.
* @return true if data is properly fed; false if no data is available
* immediately and thread should be freed
while (!parsingRequestLineEol) {
// Read new bytes if needed
if (pos >= lastValid) {
- if (!fill(true, false)) //reques line parsing
+ if (!fill(true, false)) //request line parsing
return false;
}
/**
* Flush the response.
*
- * @throws IOException an undelying I/O error occured
+ * @throws IOException an underlying I/O error occurred
*
*/
@Override
/**
* End request.
*
- * @throws IOException an undelying I/O error occured
+ * @throws IOException an underlying I/O error occurred
*/
@Override
public void endRequest() throws IOException {
/**
- * Send an acknoledgement.
+ * Send an acknowledgment.
*/
@Override
public void sendAck() throws IOException {
/**
* Commit the response.
*
- * @throws IOException an undelying I/O error occured
+ * @throws IOException an underlying I/O error occurred
*/
@Override
protected void commit()
/**
- * Send an acknoledgement.
+ * Send an acknowledgment.
*/
@Override
public void sendAck()
/**
* Commit the response.
*
- * @throws IOException an undelying I/O error occured
+ * @throws IOException an underlying I/O error occurred
*/
@Override
protected void commit()
/**
- * Set the associated reauest.
+ * Set the associated request.
*/
public void setRequest(Request request) {
}
// evaluate expr-a to value-a
Object base = this.children[0].getValue(ctx);
- // if our base is null (we know there are more properites to evaluate)
+ // if our base is null (we know there are more properties to evaluate)
if (base == null) {
throw new PropertyNotFoundException(MessageFactory.get(
"error.unreachable.base", this.children[0].getImage()));
/**
* This is the last token that has been consumed successfully. If
* this object has been created due to a parse error, the token
- * followng this token will (therefore) be the first error token.
+ * following this token will (therefore) be the first error token.
*/
public Token currentToken;