GWTApplication.client
Class FaultUpdateMonitor

java.lang.Object
  extended by com.google.gwt.user.client.Timer
      extended by GWTApplication.client.FaultUpdateMonitor

 class FaultUpdateMonitor
extends com.google.gwt.user.client.Timer

This class will be used to check the database intermittingly to see if any of the faults which listeners have registered an interest in have been updated. If any faults have been updated then the listeners are informed of the faults which have changed since the last time that we checked.

Version:
$Id: FaultUpdateMonitor.java,v 1.6 2007/09/06 07:58:12 cb Exp $
Author:
Craige Bevil
See Also:
SearchResultFormatter

Field Summary
private  InternationalizationConstants internationalizationConstants
          This class will be used for internationalization so that we can flick between the locales of English and Spanish.
(package private)  java.util.HashMap Listeners
          This is a list of the fault listeners
(package private)  FaultServiceAsync svc
          This is the service which will be used to access the servlet which is running in the tomcat container
(package private)  java.util.Date timeOfLastUpdateCheck
          This is the time in milliseconds since 1970 since the last time that we checked if the faults had been updated
 
Constructor Summary
FaultUpdateMonitor(FaultServiceAsync svc)
          Constructor
 
Method Summary
 void addListener(FaultListener faultListener)
          Will be used by a client to register itself as a listener so that it will be informed when faults which it is interested in are changed in the database.
 void run()
          Obligation of the TimerTask interface and is called intermittingly.
 
Methods inherited from class com.google.gwt.user.client.Timer
cancel, schedule, scheduleRepeating
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

svc

FaultServiceAsync svc
This is the service which will be used to access the servlet which is running in the tomcat container


timeOfLastUpdateCheck

java.util.Date timeOfLastUpdateCheck
This is the time in milliseconds since 1970 since the last time that we checked if the faults had been updated


Listeners

java.util.HashMap Listeners
This is a list of the fault listeners


internationalizationConstants

private InternationalizationConstants internationalizationConstants
This class will be used for internationalization so that we can flick between the locales of English and Spanish.

Constructor Detail

FaultUpdateMonitor

FaultUpdateMonitor(FaultServiceAsync svc)
Constructor

Method Detail

run

public void run()
Obligation of the TimerTask interface and is called intermittingly. This calls servlet operation which will check to see if any of the faults have been updated and if so it will inform the listener.

Specified by:
run in class com.google.gwt.user.client.Timer

addListener

public void addListener(FaultListener faultListener)
Will be used by a client to register itself as a listener so that it will be informed when faults which it is interested in are changed in the database.

Parameters:
faultListener - This is the object which will be called when any one of the faults listed in the faultsOfInterest array are updated.