org.directwebremoting.impl
Class PollingServerLoadMonitor

java.lang.Object
  extended by org.directwebremoting.impl.AbstractServerLoadMonitor
      extended by org.directwebremoting.impl.PollingServerLoadMonitor
All Implemented Interfaces:
ServerLoadMonitor, UninitializingBean

public class PollingServerLoadMonitor
extends AbstractServerLoadMonitor

A default implementation of ServerLoadMonitor

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Constructor Summary
PollingServerLoadMonitor()
           
 
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 setDisconnectedTime(int disconnectedTime)
          Accessor for the disconnected time.
 void setTimeToNextPoll(int disconnectedTime)
          Deprecated. Use setDisconnectedTime(int) instead
 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.
 
Methods inherited from class org.directwebremoting.impl.AbstractServerLoadMonitor
contextDestroyed, servletDestroyed, shutdownRandomWaitControllers, threadWaitEnding, threadWaitStarting
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PollingServerLoadMonitor

public PollingServerLoadMonitor()
Method Detail

supportsStreaming

public boolean supportsStreaming()
Description copied from interface: ServerLoadMonitor
If the server is not going to be streaming then we need to tell browsers to just use XHR rather than anything fancier.

Returns:
true if the server will be supporting streaming

getConnectedTime

public long getConnectedTime()
Description copied from interface: ServerLoadMonitor
What's the longest time that we should wait before asking the client to reconnect?

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 BasePollHandler?

Returns:
How long should this client wait until it next polls?

setTimeToNextPoll

@Deprecated
public void setTimeToNextPoll(int disconnectedTime)
Deprecated. Use setDisconnectedTime(int) instead

Accessor for the disconnected time.

Parameters:
disconnectedTime - How long should clients spend disconnected

setDisconnectedTime

public void setDisconnectedTime(int disconnectedTime)
Accessor for the disconnected time.

Parameters:
disconnectedTime - How long should clients spend disconnected

Copyright 2008