{
HttpConnection.HttpRequestMessage httpRequestMessage = (HttpConnection.HttpRequestMessage)message.getMessageBody()[0];
try
{
HttpRequest httpRequest = httpRequestMessage.getHttpRequest();
HttpWriteResponse httpServerResponse = new HttpWriteResponse(httpRequest);
if(httpRequest.getMethod().toUpperCase().equals("GET"))
{
// handle the get request type
doGet(httpRequest, httpServerResponse);
}
else if(httpRequest.getMethod().toUpperCase().equals("POST"))
{
// handle the POST request type
doPost(httpRequest, httpServerResponse);
}
// write the response we have constructed into the socket
ByteBuffer buffer = httpServerResponse.flush();
httpRequestMessage.getHttpConnection().write(buffer);
}
catch(Exception e)
{
logger_.warn(LogUtil.throwableToString(e));