Right Java tools for J2EE, Web Service, Grid and more
|Home | Products | Documents | Downloads | Purchase | Support | Company | Partners | Contact |

com.acelet.s.watchdog
Interface Triggering


public interface Triggering

Triggering is the interface for user defined triggers of SuperWatchdog.

The following example piece can be used for a file timestamp trigger (as an example only):

  public long getTriggerTime() {
    return triggerTime;
  }

  public boolean isTriggered() throws Exception {
    long timestamp = theFile.lastModified();
    if (timestamp > comingChore.lastTriggerTime) {
      triggerTime = timestamp;
      return true;
    }
    return false;
  }
 


Field Summary
static java.lang.String version
           
 
Method Summary
 java.lang.String getTriggerStamp()
          getTriggerStamp returns the unique stamp to identify the trigger, if the result of getTriggerTime( ) alone can not unique identify the trigger.
 long getTriggerTime()
          getTriggerTime returns the actual time when the trigger was triggered.
 void removeListener(com.acelet.s.watchdog.Watchable watchable)
           
 void setListener(com.acelet.s.watchdog.Watchable watchable, com.acelet.s.chore.Chore comingChore)
          setListener Set listener and Chore information.
 void stop()
           
 

Field Detail

version

static final java.lang.String version
See Also:
Constant Field Values
Method Detail

getTriggerStamp

java.lang.String getTriggerStamp()
getTriggerStamp returns the unique stamp to identify the trigger, if the result of getTriggerTime( ) alone can not unique identify the trigger.


getTriggerTime

long getTriggerTime()
getTriggerTime returns the actual time when the trigger was triggered.


removeListener

void removeListener(com.acelet.s.watchdog.Watchable watchable)

setListener

void setListener(com.acelet.s.watchdog.Watchable watchable,
                 com.acelet.s.chore.Chore comingChore)
                 throws java.lang.Exception
setListener Set listener and Chore information. Automatically activate the trigger

Throws:
java.lang.Exception

stop

void stop()
          throws java.lang.Exception
Throws:
java.lang.Exception

Copyright Acelet Corporation. 2000-2008. All rights reserved.