// Methods called by action()
protected abstract void actionInternal(ActionCode actionCode, Object param);
- protected abstract void finish() throws IOException;
// Methods called by prepareResponse()
protected abstract void output(byte[] src, int offset, int length)
}
+ /**
+ * Finish AJP response.
+ */
+ protected void finish() throws IOException {
+
+ if (!response.isCommitted()) {
+ // Validate and write response headers
+ try {
+ prepareResponse();
+ } catch (IOException e) {
+ // Set error flag
+ error = true;
+ }
+ }
+
+ if (finished)
+ return;
+
+ finished = true;
+
+ // Add the end message
+ if (error) {
+ output(endAndCloseMessageArray, 0, endAndCloseMessageArray.length);
+ } else {
+ output(endMessageArray, 0, endMessageArray.length);
+ }
+ }
+
+
// ------------------------------------- InputStreamInputBuffer Inner Class
/**
- * Finish AJP response.
- */
- @Override
- protected void finish() throws IOException {
-
- if (!response.isCommitted()) {
- // Validate and write response headers
- try {
- prepareResponse();
- } catch (IOException e) {
- // Set error flag
- error = true;
- }
- }
-
- if (finished)
- return;
-
- finished = true;
-
- // Add the end message
- byte[] messageArray;
- if (error) {
- messageArray = endAndCloseMessageArray;
- } else {
- messageArray = endMessageArray;
- }
- if (outputBuffer.position() + messageArray.length > outputBuffer.capacity()) {
- flush(false);
- }
- outputBuffer.put(messageArray);
- flush(false);
-
- }
-
-
- /**
* Read at least the specified amount of bytes, and place them
* in the input buffer.
*/
writeBuffer.clear();
}
- /**
- * Finish AJP response.
- */
- @Override
- protected void finish() throws IOException {
-
- if (!response.isCommitted()) {
- // Validate and write response headers
- try {
- prepareResponse();
- } catch (IOException e) {
- // Set error flag
- error = true;
- }
- }
-
- if (finished)
- return;
-
- finished = true;
-
- // Add the end message
- byte[] messageArray;
- if (error) {
- messageArray = endAndCloseMessageArray;
- } else {
- messageArray = endMessageArray;
- }
- output(messageArray, 0, messageArray.length);
- }
-
/**
* Read the specified amount of bytes, and place them in the input buffer.
output.write(src, offset, length);
}
- /**
- * Finish AJP response.
- */
- @Override
- protected void finish() throws IOException {
-
- if (!response.isCommitted()) {
- // Validate and write response headers
- try {
- prepareResponse();
- } catch (IOException e) {
- // Set error flag
- error = true;
- }
- }
-
- if (finished)
- return;
-
- finished = true;
-
- // Add the end message
- output.write(error ? endAndCloseMessageArray : endMessageArray);
-
- }
-
/**
* Read at least the specified amount of bytes, and place them