org.ow2.jonas.web.base.proxy
Class HttpSocketHandler

java.lang.Object
  extended by org.ow2.jonas.web.base.proxy.HttpSocketHandler
All Implemented Interfaces:
Runnable

public class HttpSocketHandler
extends Object
implements Runnable

Class that is handling the client socket.

Author:
Florent Benoit

Constructor Summary
HttpSocketHandler(HttpOnDemandProxy onDemandProxy, Socket clientSocket)
          Create a new handler for the given socket.
 
Method Summary
protected  void analyzeRequest()
          Analyze the request sent by the client.
 void cleanup()
           
 void cleanup(String message)
          Send an error message.
 void cleanup(String message, Exception exception)
          Send an error message with its exception
protected  void contextIsStarting(String contextName)
          Tell to the client that the context is starting.
 void run()
          Handle the request on the selected socket.
protected  void sendBytesToClient(HTTPResponse httpResponse)
          Send the given response to the client.
protected  void sendWaitGif()
          Send the wait gif
protected  void startWebContainer()
          Asked to start the web container
protected  void webContainerIsStarting()
          Tell to the client that the web container is starting.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpSocketHandler

public HttpSocketHandler(HttpOnDemandProxy onDemandProxy,
                         Socket clientSocket)
                  throws HttpOnDemandProxyException
Create a new handler for the given socket.

Parameters:
onDemandProxy - the http on demand proxy
clientSocket - the given client socket
Throws:
HttpOnDemandProxyException - if unable to get streams
Method Detail

analyzeRequest

protected void analyzeRequest()
                       throws HttpOnDemandProxyException
Analyze the request sent by the client.

Throws:
HttpOnDemandProxyException - if request cannot be analyzed

cleanup

public void cleanup()

cleanup

public void cleanup(String message)
Send an error message.

Parameters:
message - the given error message

cleanup

public void cleanup(String message,
                    Exception exception)
Send an error message with its exception

Parameters:
message - the given message
exception - the given exception

sendBytesToClient

protected void sendBytesToClient(HTTPResponse httpResponse)
Send the given response to the client.

Parameters:
httpResponse - the given response

startWebContainer

protected void startWebContainer()
Asked to start the web container


webContainerIsStarting

protected void webContainerIsStarting()
Tell to the client that the web container is starting.


sendWaitGif

protected void sendWaitGif()
Send the wait gif


contextIsStarting

protected void contextIsStarting(String contextName)
Tell to the client that the context is starting.


run

public void run()
Handle the request on the selected socket.

Specified by:
run in interface Runnable


Copyright © 2010 OW2 Consortium. All Rights Reserved.