public class LoadBalancing extends Object implements Runnable
Whenever there is a new client request for a resource that is load balanced, the controller checks which slave (or the controller itself) for the best suited server in terms of concurrent users and maximum amount.
Modifier and Type | Method and Description |
---|---|
static void |
dispose()
Disposes of the load balancing at server shut-down (soft or hard).
|
static void |
fillStatisticsList(VirtualCListBox list)
Fills the list box with statistics data from the load balancer.
|
static String |
getControllerHostName()
Gets the controller host name.
|
static int |
getControllerPortNumber()
Gets the port number to the controlling master server for this
slave server as configured in Load Balancing for Host address
and Port number.
|
static int |
getControllerPortNumber(HttpSession httpSession)
Gets the port number of the current connection that the controller
server uses.
|
static int |
getControllerPortNumber(ServerSocketInterface ssi)
Gets the port number of the current connection that the controller
server uses.
|
static String |
getFullControllerServerName(HttpSession httpSession)
Gets the full server
|
static String |
getFullControllerServerName(ServerSocketInterface ssi)
Gets the full controller server name.
|
static String |
getPossibleRedirection(ServerSocketInterface ssi,
AdminConfigResource resConf,
String resource)
Gets a possible redirection (protocol://address/...).
|
static boolean |
handleSlave(AdminCommandProcessor acp)
Handles a new load balancer slave in the controller.
|
static void |
initialize(IniFile ini)
Initializes the load balancing at web server start or restart.
|
static boolean |
isController()
Checks if the server is a controller.
|
static boolean |
isInitialized()
Checks if it's initialized.
|
static boolean |
isSlave()
Checks if a server is a load balancing slave.
|
static void |
onGroupsChanged(Hashtable<String,AdminConfigGroups> old)
Called when groups have been edited and are therefore changed.
|
static void |
onUserChanged(AdminConfigUser user)
Called when a user have been changed.
|
static void |
onUsersChanged(Hashtable<String,AdminConfigUser> old)
Called when users have been edited and are therefore changed.
|
static void |
portStarted(ClientConnectionInterface socket)
Informs the load balancer that a port is started.
|
static void |
portStopped(ClientConnectionInterface socket)
Informs the load balancer that a port is stopped (closed).
|
static void |
requestSlavePerformanceData(Hashtable<String,Object> table,
int waitTime)
Request load balancing info from every slave, and
in the hashtable, put the name of the slave server as
the key and a "new Object()" as the element.
|
void |
run()
The notifyer thread.
|
static void |
setNpAppUsers(int currentCount,
int maxCount)
Sets the number of concurrent NetPhantom application users.
|
static void |
setWebRequests(int currentCount,
int maxCount)
Sets the number of concurrent Web Server requests not yet processed.
|
public static void initialize(IniFile ini)
public static boolean isInitialized()
public static boolean isSlave()
public static boolean isController()
public static void dispose()
public static void fillStatisticsList(VirtualCListBox list)
The list contains:
- Host name - Port ID - Port Number - Current users - Maximum users
public static void portStarted(ClientConnectionInterface socket)
public static void portStopped(ClientConnectionInterface socket)
public static boolean handleSlave(AdminCommandProcessor acp)
No errors are returned, because the load balancer will log the appropriate events.
public static void requestSlavePerformanceData(Hashtable<String,Object> table, int waitTime)
public static void setNpAppUsers(int currentCount, int maxCount)
public static void setWebRequests(int currentCount, int maxCount)
public static void onUserChanged(AdminConfigUser user)
public static void onUsersChanged(Hashtable<String,AdminConfigUser> old)
public static void onGroupsChanged(Hashtable<String,AdminConfigGroups> old)
public static int getControllerPortNumber(HttpSession httpSession)
public static int getControllerPortNumber(ServerSocketInterface ssi)
public static int getControllerPortNumber()
public static String getControllerHostName()
public static String getFullControllerServerName(HttpSession httpSession)
public static String getFullControllerServerName(ServerSocketInterface ssi)
public static String getPossibleRedirection(ServerSocketInterface ssi, AdminConfigResource resConf, String resource)
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.