public void action(ActionCode actionCode, Object param) {
if( actionCode==ActionCode.ACTION_COMMIT ) {
if( log.isLoggable(Level.FINEST) ) {
log.finest("COMMIT " );
}
Response res=(Response)param;
if( res.isCommitted() ) {
if( log.isLoggable(Level.FINEST) ) {
log.finest("Response already committed " );
}
} else {
try {
jkIS.appendHead( res );
} catch(IOException iex) {
log.log(Level.WARNING, "Unable to send headers",iex);
setStatus(JK_STATUS_ERROR);
}
}
} else if( actionCode==ActionCode.ACTION_RESET ) {
if( log.isLoggable(Level.FINEST) ) {
log.finest("RESET " );
}
} else if( actionCode==ActionCode.ACTION_CLIENT_FLUSH ) {
if( log.isLoggable(Level.FINEST) ) {
log.finest("CLIENT_FLUSH " );
}
Response res = (Response)param;
if(!res.isCommitted()) {
action(ActionCode.ACTION_COMMIT, res);
}
try {
source.flush( null, this );
} catch(IOException iex) {
// This is logged elsewhere, so debug only here
log.log(Level.FINEST, "Error during flush",iex);
res.setErrorException(iex);
setStatus(JK_STATUS_ERROR);
}
} else if( actionCode==ActionCode.ACTION_CLOSE ) {
if( log.isLoggable(Level.FINEST) ) {
log.finest("CLOSE " );
}
Response res=(Response)param;
if( getStatus()== JK_STATUS_CLOSED || getStatus() == JK_STATUS_ERROR) {
// Double close - it may happen with forward
if( log.isLoggable(Level.FINEST) ) {
log.finest("Double CLOSE - forward ? " +
res.getRequest().requestURI() );
}
return;
}
if( !res.isCommitted() )
this.action( ActionCode.ACTION_COMMIT, param );
try {
jkIS.endMessage();
} catch(IOException iex) {
log.log(Level.FINEST, "Error sending end packet",iex);
setStatus(JK_STATUS_ERROR);
}
if(getStatus() != JK_STATUS_ERROR) {
setStatus(JK_STATUS_CLOSED );
}
if( logTime.isLoggable(Level.FINEST) )
logTime(res.getRequest(), res);
} else if( actionCode==ActionCode.ACTION_REQ_SSL_ATTRIBUTE ) {
Request req=(Request)param;
// Extract SSL certificate information (if requested)
MessageBytes certString = (MessageBytes)req.getNote(WorkerEnv.SSL_CERT_NOTE);