// Methods called by action()
protected abstract void actionInternal(ActionCode actionCode, Object param);
- protected abstract void flush(boolean tbd) throws IOException;
protected abstract void finish() throws IOException;
// Methods called by prepareResponse()
/**
+ * Callback to write data from the buffer.
+ */
+ protected void flush(boolean explicit) throws IOException {
+ if (explicit && !finished) {
+ // Send the flush message
+ output(flushMessageArray, 0, flushMessageArray.length);
+ }
+ }
+
+
+ /**
* After reading the request headers, we have to setup the request filters.
*/
protected void prepareRequest() {
protected void output(byte[] src, int offset, int length)
throws IOException {
outputBuffer.put(src, offset, length);
+
+ long socketRef = socket.getSocket().longValue();
+
+ if (outputBuffer.position() > 0) {
+ if ((socketRef != 0) && Socket.sendbb(socketRef, 0, outputBuffer.position()) < 0) {
+ throw new IOException(sm.getString("ajpprocessor.failedsend"));
+ }
+ outputBuffer.clear();
+ }
}
outputBuffer.clear();
}
-
-
- /**
- * Callback to write data from the buffer.
- */
- @Override
- protected void flush(boolean explicit) throws IOException {
-
- long socketRef = socket.getSocket().longValue();
-
- if (outputBuffer.position() > 0) {
- if ((socketRef != 0) && Socket.sendbb(socketRef, 0, outputBuffer.position()) < 0) {
- throw new IOException(sm.getString("ajpprocessor.failedsend"));
- }
- outputBuffer.clear();
- }
- // Send explicit flush message
- if (explicit && !finished && (socketRef != 0)) {
- if (Socket.send(socketRef, flushMessageArray, 0,
- flushMessageArray.length) < 0) {
- throw new IOException(sm.getString("ajpprocessor.failedflush"));
- }
- }
- }
}
}
- /**
- * Callback to write data from the buffer.
- */
- @Override
- protected void flush(boolean explicit) throws IOException {
- if (explicit && !finished) {
- // Send the flush message
- output(flushMessageArray, 0, flushMessageArray.length);
- }
- }
}
return true;
}
}
-
-
- /**
- * Callback to write data from the buffer.
- */
- @Override
- protected void flush(boolean explicit) throws IOException {
- if (explicit && !finished) {
- // Send the flush message
- output.write(flushMessageArray);
- }
- }
}