Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.directwebremoting.impl
Class ThreadDroppingServerLoadMonitor

    java.lang.Object
      org.directwebremoting.impl.AbstractServerLoadMonitor
          org.directwebremoting.impl.ThreadDroppingServerLoadMonitor

All Implemented Interfaces:
  ServerLoadMonitor

    public class ThreadDroppingServerLoadMonitor

extends AbstractServerLoadMonitor
implements ServerLoadMonitor

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.

Author:
  Joe Walker [joe at getahead dot org]

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)`
`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
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.directwebremoting.extend.ServerLoadMonitor
`shutdown`

Constructor Detail

### ThreadDroppingServerLoadMonitor

    public ThreadDroppingServerLoadMonitor()

Method Detail

### getConnectedTime

    public long getConnectedTime()

  Description copied from interface: `ServerLoadMonitor`
  What's the longest time that we should wait before asking the client to reconnect?

  Specified by:
    `getConnectedTime` in interface `ServerLoadMonitor`
  Returns:
    The maximum client connected time

### getDisconnectedTime

    public int getDisconnectedTime()

  Description copied from interface: `ServerLoadMonitor`
  Controller for poll times.

  TODO: We should probably get rid of this and leave it to PollHandler?

  Specified by:
    `getDisconnectedTime` in interface `ServerLoadMonitor`
  Returns:
    How long should this client wait until it next polls?

### threadWaitStarting

    public void threadWaitStarting(WaitController controller)

  Description copied from interface: `ServerLoadMonitor`
  A thread is about to begin a wait period. This can be used by implementations to dynamically adjust the poll timings.

  Specified by:
    `threadWaitStarting` in interface `ServerLoadMonitor`
  Overrides:
    `threadWaitStarting` in class `AbstractServerLoadMonitor`
  Parameters:
    `controller` - An object that we can use to control the wait

### threadWaitEnding

    public void threadWaitEnding(WaitController controller)

  Description copied from interface: `ServerLoadMonitor`
  A thread has just ended a wait period. This can be used by implementations to dynamically adjust the poll timings.

  Specified by:
    `threadWaitEnding` in interface `ServerLoadMonitor`
  Overrides:
    `threadWaitEnding` in class `AbstractServerLoadMonitor`
  Parameters:
    `controller` - An object that we can use to control the wait

### setMaxHitsPerSecond

    public void setMaxHitsPerSecond(int maxHitsPerSecond)

  Parameters:
    `maxHitsPerSecond` - the maxHitsPerSecond to set

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Copyright ¬ 2005
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD