| |
|
| java.lang.Object org.getahead.dwrdemo.clock.Clock
Clock | public class Clock implements Runnable(Code) | | A server-side clock that broadcasts the server time to any browsers that will
listen.
This is an example of how to control clients using server side threads
author: Joe Walker [joe at getahead dot ltd dot uk] |
Field Summary | |
protected transient boolean | active |
Constructor Summary | |
public | Clock() Create a schedule to update the clock every second. |
Method Summary | |
public void | run() | public void | setClockDisplay(String output) Actually alter the clients.
In DWR 2.x you had to know the ServletContext in order to be able to get
a ServerContext. | public synchronized void | toggle() |
active | protected transient boolean active(Code) | | Are we updating the clocks on all the pages?
|
Clock | public Clock()(Code) | | Create a schedule to update the clock every second.
|
setClockDisplay | public void setClockDisplay(String output)(Code) | | Actually alter the clients.
In DWR 2.x you had to know the ServletContext in order to be able to get
a ServerContext. With DWR 3.0 this restriction has been removed.
This method is public so you can call this from the dwr auto-generated
pages to demo altering one page from another
Parameters: output - The string to display. |
toggle | public synchronized void toggle()(Code) | | Called from the client to turn the clock on/off
|
|
|
|