|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.server.cluster.ServerPool
public class ServerPool
A pool of connections to a Resin server.
| Constructor Summary | |
|---|---|
ServerPool(java.lang.String serverId,
ClusterServer server)
|
|
ServerPool(java.lang.String serverId,
java.lang.String targetId,
java.lang.String address,
int port,
boolean isSecure)
|
|
| Method Summary | |
|---|---|
void |
allocateLoadBalance()
Allocate a connection for load balancing. |
void |
busy()
Called when the server responds with "busy", e.g. |
boolean |
canConnect()
Returns true if can connect to the client. |
boolean |
canOpenSoft()
Returns true if the server can open a connection. |
boolean |
canOpenSoftOrRecycle()
Returns true if the server can open a connection. |
void |
clearRecycle()
Clears the recycled connections, e.g. |
void |
close()
Close the client |
void |
disable()
Disable the client |
void |
enable()
Enable the client |
void |
enableSessionOnly()
Session only |
void |
failConnect()
Called when the socket read/write fails. |
void |
failSocket()
Called when the socket read/write fails. |
void |
freeLoadBalance()
Free a connection for load balancing. |
int |
getActiveCount()
Returns the number of active connections. |
java.lang.String |
getAddress()
Returns the hostname of the target server. |
long |
getBusyCountTotal()
Returns the count of busy connections. |
long |
getConnectCountTotal()
Returns the total number of successful socket connections |
double |
getCpuLoadAvg()
Gets the CPU load avg |
java.lang.String |
getDebugId()
Returns the debug id. |
long |
getFailCountTotal()
Returns the total number of failed connect attempts. |
java.lang.String |
getId()
Returns the user-readable id of the target server. |
int |
getIdleCount()
Returns the number of idle connections. |
long |
getKeepaliveCountTotal()
Returns the number of times a keepalive connection has been used. |
java.util.Date |
getLastBusyTime()
Returns the time of the last busy. |
java.util.Date |
getLastFailConnectTime()
Returns the time of the last failure. |
java.util.Date |
getLastFailTime()
Returns the time of the last failure. |
long |
getLastSuccessTime()
Returns the time of the last failure. |
double |
getLatencyFactor()
Returns the latency factory |
int |
getLoadBalanceAllocateCount()
Returns the number of load balance allocations |
long |
getLoadBalanceConnectTimeout()
The socket timeout when connecting to the target server. |
long |
getLoadBalanceIdleTime()
How long the connection can be cached in the free pool. |
long |
getLoadBalanceSocketTimeout()
The socket timeout when reading from the target server. |
int |
getLoadBalanceWeight()
The load balance weight. |
int |
getPort()
Gets the port of the target server. |
java.lang.String |
getState()
Returns the lifecycle state. |
void |
init()
Initialize |
boolean |
isActive()
Returns true if the server is active. |
boolean |
isDead()
Returns true if the server is dead. |
boolean |
isEnabled()
Return true if active. |
boolean |
message(java.lang.String to,
java.io.Serializable message)
Non-blocking message |
ClusterStream |
open()
Open a stream to the target server for the load balancer. |
ClusterStream |
openForSession()
Open a stream to the target server for a session. |
ClusterStream |
openIfLive()
Open a stream to the target server object persistence. |
ClusterStream |
openSoft()
Open a stream to the target server. |
java.lang.Object |
queryGet(java.lang.String to,
java.io.Serializable query)
Blocking 'GET' query |
java.lang.Object |
querySet(java.lang.String to,
java.io.Serializable query)
|
void |
setCpuLoadAvg(double load)
Sets the CPU load avg (from backend). |
void |
setLoadBalanceConnectTimeout(long timeout)
The socket timeout when connecting to the target server. |
void |
setLoadBalanceIdleTime(long timeout)
How long the connection can be cached in the free pool. |
void |
setLoadBalanceRecoverTime(long timeout)
Returns how long the connection will be treated as dead. |
void |
setLoadBalanceSocketTimeout(long timeout)
The socket timeout when reading from the target server. |
void |
setLoadBalanceWarmupTime(long timeout)
Returns the time in milliseconds for the slow start throttling. |
void |
setLoadBalanceWeight(int weight)
The load balance weight. |
void |
start()
Enable the client. |
void |
stop()
Disable the client. |
void |
toBusy()
|
void |
toFail()
|
java.lang.String |
toString()
|
void |
wake()
We now know that the server is live, e.g. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ServerPool(java.lang.String serverId,
java.lang.String targetId,
java.lang.String address,
int port,
boolean isSecure)
public ServerPool(java.lang.String serverId,
ClusterServer server)
| Method Detail |
|---|
public java.lang.String getId()
public java.lang.String getDebugId()
public java.lang.String getAddress()
public int getPort()
public long getLoadBalanceConnectTimeout()
public void setLoadBalanceConnectTimeout(long timeout)
public long getLoadBalanceSocketTimeout()
public void setLoadBalanceSocketTimeout(long timeout)
public long getLoadBalanceIdleTime()
public void setLoadBalanceIdleTime(long timeout)
public void setLoadBalanceRecoverTime(long timeout)
public void setLoadBalanceWarmupTime(long timeout)
public int getLoadBalanceWeight()
public void setLoadBalanceWeight(int weight)
public void init()
throws java.lang.Exception
java.lang.Exceptionpublic int getActiveCount()
public int getIdleCount()
public int getLoadBalanceAllocateCount()
public void allocateLoadBalance()
public void freeLoadBalance()
public long getConnectCountTotal()
public long getKeepaliveCountTotal()
public long getFailCountTotal()
public java.util.Date getLastFailTime()
public java.util.Date getLastFailConnectTime()
public long getLastSuccessTime()
public double getLatencyFactor()
public long getBusyCountTotal()
public java.util.Date getLastBusyTime()
public void setCpuLoadAvg(double load)
public double getCpuLoadAvg()
public final boolean isActive()
public boolean isDead()
public void enable()
public void disable()
public java.lang.String getState()
public boolean canOpenSoftOrRecycle()
public boolean canOpenSoft()
public boolean isEnabled()
public void toBusy()
public void toFail()
public void failSocket()
public void failConnect()
public void busy()
public void start()
public void stop()
public void enableSessionOnly()
public ClusterStream openSoft()
public ClusterStream openIfLive()
public ClusterStream openForSession()
public ClusterStream open()
public void wake()
public void clearRecycle()
public void close()
public boolean canConnect()
public boolean message(java.lang.String to,
java.io.Serializable message)
public java.lang.Object queryGet(java.lang.String to,
java.io.Serializable query)
public java.lang.Object querySet(java.lang.String to,
java.io.Serializable query)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||