// -------------------- Coyote Action implementation --------------------
public void action(ActionCode actionCode, Object param) {
if( actionCode==ActionCode.ACTION_COMMIT ) {
if( log.isDebugEnabled() ) log.debug("COMMIT " );
Response res=(Response)param;
if( res.isCommitted() ) {
if( log.isDebugEnabled() )
log.debug("Response already committed " );
} else {
try {
jkIS.appendHead( res );
} catch(IOException iex) {
log.warn("Unable to send headers",iex);
setStatus(JK_STATUS_ERROR);
}
}
} else if( actionCode==ActionCode.ACTION_RESET ) {
if( log.isDebugEnabled() )
log.debug("RESET " );
} else if( actionCode==ActionCode.ACTION_CLIENT_FLUSH ) {
if( log.isDebugEnabled() ) log.debug("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.debug("Error during flush",iex);
res.setErrorException(iex);
setStatus(JK_STATUS_ERROR);
}
} else if( actionCode==ActionCode.ACTION_CLOSE ) {
if( log.isDebugEnabled() ) log.debug("CLOSE " );
Response res=(Response)param;
if( getStatus()== JK_STATUS_CLOSED || getStatus() == JK_STATUS_ERROR) {
// Double close - it may happen with forward
if( log.isDebugEnabled() ) log.debug("Double CLOSE - forward ? " + res.getRequest().requestURI() );
return;
}
if( !res.isCommitted() )
this.action( ActionCode.ACTION_COMMIT, param );
try {
jkIS.endMessage();
} catch(IOException iex) {
log.debug("Error sending end packet",iex);
setStatus(JK_STATUS_ERROR);
}
if(getStatus() != JK_STATUS_ERROR) {
setStatus(JK_STATUS_CLOSED );
}
if( logTime.isDebugEnabled() )
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);