|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.directwebremoting.impl.AbstractServerLoadMonitor
org.directwebremoting.impl.ThreadDroppingServerLoadMonitor
public class ThreadDroppingServerLoadMonitor
A smart implementation of ServerLoadMonitor, customized for Jetty. The ThreadDroppingServerLoadMonitor attempts to keep the hit rate down by increasing the disconnected time as usage increases.
Field Summary | |
---|---|
protected int |
connectedTime
The time we are currently waiting before sending a browser away and asking it to reconnect. |
protected int |
disconnectedTime
How long are we telling users to wait before they come back next |
protected HitMonitor |
hitMonitor
Our record of the server loading |
protected int |
maxHitsPerSecond
Static configuration data: The max number of hits per second. |
protected static int |
SECONDS_MONITORED
We are recording the number of hits in the last 5 seconds. |
Fields inherited from class org.directwebremoting.impl.AbstractServerLoadMonitor |
---|
waitControllers |
Constructor Summary | |
---|---|
ThreadDroppingServerLoadMonitor()
|
Method Summary | |
---|---|
long |
getConnectedTime()
What's the longest time that we should wait before asking the client to reconnect? |
int |
getDisconnectedTime()
Controller for poll times. |
void |
setMaxHitsPerSecond(int maxHitsPerSecond)
|
boolean |
supportsStreaming()
If the server is not going to be streaming then we need to tell browsers to just use XHR rather than anything fancier. |
void |
threadWaitEnding(WaitController controller)
A thread has just ended a wait period. |
void |
threadWaitStarting(WaitController controller)
A thread is about to begin a wait period. |
Methods inherited from class org.directwebremoting.impl.AbstractServerLoadMonitor |
---|
shutdown, shutdownRandomWaitControllers |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.directwebremoting.extend.ServerLoadMonitor |
---|
shutdown |
Field Detail |
---|
protected int maxHitsPerSecond
protected int connectedTime
protected int disconnectedTime
protected static final int SECONDS_MONITORED
protected HitMonitor hitMonitor
Constructor Detail |
---|
public ThreadDroppingServerLoadMonitor()
Method Detail |
---|
public boolean supportsStreaming()
ServerLoadMonitor
supportsStreaming
in interface ServerLoadMonitor
public long getConnectedTime()
ServerLoadMonitor
getConnectedTime
in interface ServerLoadMonitor
public int getDisconnectedTime()
ServerLoadMonitor
TODO: We should probably get rid of this and leave it to PollHandler?
getDisconnectedTime
in interface ServerLoadMonitor
public void threadWaitStarting(WaitController controller)
ServerLoadMonitor
threadWaitStarting
in interface ServerLoadMonitor
threadWaitStarting
in class AbstractServerLoadMonitor
controller
- An object that we can use to control the waitpublic void threadWaitEnding(WaitController controller)
ServerLoadMonitor
threadWaitEnding
in interface ServerLoadMonitor
threadWaitEnding
in class AbstractServerLoadMonitor
controller
- An object that we can use to control the waitpublic void setMaxHitsPerSecond(int maxHitsPerSecond)
maxHitsPerSecond
- the maxHitsPerSecond to set
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |