org.jboss.web.loadbalancer
Class Loadbalancer

java.lang.Object
  extended byorg.jboss.web.loadbalancer.Loadbalancer

public class Loadbalancer
extends java.lang.Object

The Loadbalancer core class.


Field Summary
protected  MultiThreadedHttpConnectionManager connectionManager
           
protected  int connectionTimeout
           
protected static java.util.Set ignorableHeader
           
protected static Logger (src) log
           
protected static int MAX_RETRIES
           
protected  SchedulerMBean (src) scheduler
           
protected  ObjectName (src) schedulerName
           
 
Constructor Summary
protected Loadbalancer(SchedulerMBean (src)  scheduler, int timeout)
           
 
Method Summary
protected  void addRequestData(Request (src)  schedRequest)
          Add the request information to the HttpMethod
protected  void copyServerResponse(Request (src)  schedRequest)
          Copy content to the client.
protected  void createMethod(Request (src)  schedRequest)
          Create a HttpMethod object for the given request.
 int getConnectionsInUse()
          Get the currently used connections to slave hosts.
 int getConnectionTimeout()
          Get the currently used connection timeout to slave hosts.
protected  void handleRequest(Request (src)  schedRequest)
          Handle the client request.
protected  void parseServerResponse(Request (src)  schedRequest)
          Copy the server answer meta data to the client.
protected  void prepareServerRequest(Request (src)  schedRequest)
          Prepare the request to the target node.
 void setConnectionTimeout(int newTimeout)
          Set the currently used connection timeout to slave hosts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static Logger (src)  log

connectionManager

protected MultiThreadedHttpConnectionManager connectionManager

ignorableHeader

protected static java.util.Set ignorableHeader

connectionTimeout

protected int connectionTimeout

scheduler

protected SchedulerMBean (src)  scheduler

schedulerName

protected ObjectName (src)  schedulerName

MAX_RETRIES

protected static final int MAX_RETRIES
See Also:
Constant Field Values (src)
Constructor Detail

Loadbalancer

protected Loadbalancer(SchedulerMBean (src)  scheduler,
                       int timeout)
                throws ServletException
Method Detail

createMethod

protected void createMethod(Request (src)  schedRequest)
                     throws NoHostAvailableException (src) 
Create a HttpMethod object for the given request.

Returns:
Throws:
NoHostAvailableException (src)

addRequestData

protected void addRequestData(Request (src)  schedRequest)
Add the request information to the HttpMethod

Returns:

prepareServerRequest

protected void prepareServerRequest(Request (src)  schedRequest)
Prepare the request to the target node.

Returns:

handleRequest

protected void handleRequest(Request (src)  schedRequest)
                      throws ServletException,
                             java.io.IOException
Handle the client request.

Throws:
ServletException
java.io.IOException

parseServerResponse

protected void parseServerResponse(Request (src)  schedRequest)
                            throws ServletException,
                                   java.io.IOException
Copy the server answer meta data to the client.

Throws:
ServletException
java.io.IOException

copyServerResponse

protected void copyServerResponse(Request (src)  schedRequest)
                           throws java.io.IOException
Copy content to the client.

Throws:
java.io.IOException

getConnectionTimeout

public int getConnectionTimeout()
Get the currently used connection timeout to slave hosts.


setConnectionTimeout

public void setConnectionTimeout(int newTimeout)
Set the currently used connection timeout to slave hosts.


getConnectionsInUse

public int getConnectionsInUse()
Get the currently used connections to slave hosts.