|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
com.tangosol.util.Base
com.tangosol.net.LoadBalancer
public class LoadBalancer
A non-sticky HTTP load-balancer.
| Nested Class Summary | |
|---|---|
static class |
LoadBalancer.AddressPortAn AddressPort is an immutable combination of an IP address and a port number. |
static class |
LoadBalancer.QueueA Queue is used to effeciently queue up items for daemon threads to work on. |
class |
LoadBalancer.RequestHandlerA RequestHandler is a daemon thread that processes a request from a queue. |
class |
LoadBalancer.ResponseHandlerA ResponseHandler is a daemon thread that processes an outgoing response from a destination server. |
static class |
LoadBalancer.SocketHandlerA SocketHandler is an abstract daemon thread. |
| Field Summary | |
|---|---|
protected LoadBalancer.AddressPort[] |
m_aAddrPortDestThe AddressPort combinations that the load balancer will balance to. |
protected LoadBalancer.AddressPort |
m_addrportHostThe AddressPort combination that the load balancer will listen on. |
protected boolean |
m_fRoundRobinToggles between random and round-robin load balancing. |
protected int |
m_iNextDestinationRound-robin index. |
protected java.util.List |
m_listHandlerThe list of RequestHandler daemons. |
protected java.util.Properties |
m_propOptionsThe optional settings that the load balancer will use. |
protected LoadBalancer.Queue |
m_queueThe queue of pending requests. |
protected java.util.Random |
m_randomRandom number generator. |
protected java.lang.Thread |
m_threadRunningThe Thread that the load balancer is started on. |
| Constructor Summary | |
|---|---|
LoadBalancer(LoadBalancer.AddressPort addrportHost, LoadBalancer.AddressPort[] aAddrPortDest, java.util.Properties propOptions)Instantiate a LoadBalancer object that will listen on a host address/port and redirect requests to destination addresses/ports. |
|
| Method Summary | |
|---|---|
LoadBalancer.AddressPort |
getDestination(int i)Determine one of the AddressPort combinations that the load balancer balances requests to. |
int |
getDestinationCount()Determine the number of AddressPort combinations that the load balancer balances requests to. |
LoadBalancer.AddressPort |
getHost()Determine the AddressPort that the load balancer listens on. |
protected LoadBalancer.AddressPort |
getNextDestination()Determine the next AddressPort combination to route to. |
java.net.Socket |
getNextDestinationSocket()Open a socket to route to. |
boolean |
getProperty(java.lang.String sName, boolean fDefault)Determine the value of a boolean option. |
int |
getProperty(java.lang.String sName, int nDefault)Determine the value of an integer option. |
java.lang.String |
getProperty(java.lang.String sName, java.lang.String sDefault)Determine the value of a String option. |
protected LoadBalancer.Queue |
getQueue()Determine the Queue that Socket connections are placed into. |
protected LoadBalancer.AddressPort |
getRandomDestination()Determine a random AddressPort combination to route to. |
protected LoadBalancer.AddressPort |
getRoundRobinDestination()Using a round-robin algorithm, determine the next AddressPort combination to route to. |
protected LoadBalancer.Queue |
instantiateQueue()Factory method: Create a queue. |
protected LoadBalancer.RequestHandler |
instantiateRequestHandler(LoadBalancer.Queue queue)Factory method: Create a RequestHandler. |
protected LoadBalancer.ResponseHandler |
instantiateResponseHandler(LoadBalancer.RequestHandler daemonRequest)Factory method: Create a ResponseHandler. |
static void |
main(java.lang.String[] asArgs)Command-line capability to start the load balancer. |
protected static java.lang.String |
parseThreadExtension(Daemon daemon)Parse the extension glued onto the end of a daemon's thread's name. |
void |
run()Start the LoadBalancer. |
static void |
showInstructions()Display the instructions for the command-line utility. |
| Field Detail |
|---|
protected LoadBalancer.AddressPort m_addrportHost
protected LoadBalancer.AddressPort[] m_aAddrPortDest
protected java.util.Properties m_propOptions
protected java.lang.Thread m_threadRunning
protected LoadBalancer.Queue m_queue
protected java.util.List m_listHandler
protected boolean m_fRoundRobin
protected java.util.Random m_random
protected int m_iNextDestination
| Constructor Detail |
|---|
public LoadBalancer(LoadBalancer.AddressPort addrportHost,
LoadBalancer.AddressPort[] aAddrPortDest,
java.util.Properties propOptions)
addrportHost - the AddressPort combination for this hostaAddrPortDest - the array of AddressPort combinations that requests will be sent to| Method Detail |
|---|
public static void main(java.lang.String[] asArgs)
public static void showInstructions()
public void run()
run in interface java.lang.Runnablepublic LoadBalancer.AddressPort getHost()
public int getDestinationCount()
public LoadBalancer.AddressPort getDestination(int i)
i - an index in the range 0 < i < getDesinationCount()public java.net.Socket getNextDestinationSocket()
protected LoadBalancer.AddressPort getNextDestination()
protected LoadBalancer.AddressPort getRandomDestination()
protected LoadBalancer.AddressPort getRoundRobinDestination()
protected LoadBalancer.Queue getQueue()
public java.lang.String getProperty(java.lang.String sName,
java.lang.String sDefault)
sName - the property name that specifies the option to look upsDefault - the default option value to use if the option is not set
public int getProperty(java.lang.String sName,
int nDefault)
sName - the property name that specifies the option to look upnDefault - the default option value to use if the option is not set
public boolean getProperty(java.lang.String sName,
boolean fDefault)
sName - the property name that specifies the option to look upfDefault - the default option value to use if the option is not setprotected static java.lang.String parseThreadExtension(Daemon daemon)
daemon - a Daemon objectprotected LoadBalancer.Queue instantiateQueue()
protected LoadBalancer.RequestHandler instantiateRequestHandler(LoadBalancer.Queue queue)
queue - a Queue of Socket objectsprotected LoadBalancer.ResponseHandler instantiateResponseHandler(LoadBalancer.RequestHandler daemonRequest)
daemonRequest - the RequestHandler that the ResponseHandler will belong to
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||