Annotation Interface Watch


@Retention(RUNTIME) @Target(METHOD) public @interface Watch
Annotation for creating a watcher.
Version:
$Revision: 1.1 $ $Date: 2005/12/21 22:25:34 $
Author:
Nick Collier
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The fully qualified class name of the watchee..
    A comma separated list of the field names to watch in the watchee class.
    Gets when to trigger the watch: immediately or later.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Identifier for this Watch.
    int
    The number of watchers to be triggered.
    colocated - true if the watcher and the watchee are in the same context. linked_to ['network name'] - true if the watcher is linked to the watchee in any network, or optionally in the named network linked_from ['network name'] - true if the watcher is linked from the watchee in any network, or optionally in the named network within X ['network name'] - true if the path from the watcher to the watchee is less than or equal to X where X is a double precision number.
    double
    Defaults to 1
    double
    Defaults to ScheduleParameters.RANDOM_PRIORITY
    boolean
    Gets whether or not the list of watchers to be triggered is shuffled prior to triggering.
    The trigger condition for triggering the method on which this is an annotation.
  • Element Details

    • watcheeClassName

      String watcheeClassName
      The fully qualified class name of the watchee..
    • watcheeFieldNames

      String watcheeFieldNames
      A comma separated list of the field names to watch in the watchee class.
    • whenToTrigger

      WatcherTriggerSchedule whenToTrigger
      Gets when to trigger the watch: immediately or later.
      Returns:
      Gets when to trigger the watch: immediately or later.
    • id

      String id
      Identifier for this Watch.
      Default:
      ""
    • query

      String query
      • colocated - true if the watcher and the watchee are in the same context.
      • linked_to ['network name'] - true if the watcher is linked to the watchee in any network, or optionally in the named network
      • linked_from ['network name'] - true if the watcher is linked from the watchee in any network, or optionally in the named network
      • within X ['network name'] - true if the path from the watcher to the watchee is less than or equal to X where X is a double precision number. This is either for any network in the context or in the named network.
      • within_vn X ['grid name'] - true if the watchee is in the watcher's von neumann neighborhood in any grid projection or in the named grid. X is the extent of the neighborhood in the x, y, [z] dimensions.
      • within_moore X ['grid name'] - true if the watchee is in the watcher's moore neighborhood in any grid projection or in the named grid. X is the extent of the neighborhood in the x, y, [z] dimensions.
      • within X ['geography name'] - true if the orthodromic distance from the watcher to the watchee is less than or equal to X meters, otherwise false.
      Default:
      ""
    • triggerCondition

      String triggerCondition
      The trigger condition for triggering the method on which this is an annotation. The trigger condition is some arbitary boolean expression. The following variables are available to the expression $watcher, $watchee, and $context. These correspond to the watcher, watchee and context. Methods can be called on these variables. For example, $watcher.getAge() > 3, will call getAge on the watcher. The operators && and || are also supported. For example, $watcher.getAge() > 3 && watcher.getAge() > $watchee.getAge()
      Default:
      ""
    • scheduleTriggerDelta

      double scheduleTriggerDelta
      Defaults to 1
      Default:
      1.0
    • scheduleTriggerPriority

      double scheduleTriggerPriority
      Defaults to ScheduleParameters.RANDOM_PRIORITY
      Default:
      0.0/0.0
    • pick

      int pick
      The number of watchers to be triggered. The default is all watchers.
      Returns:
      The number of watchers to be triggered.
      Default:
      2147483647
    • shuffle

      boolean shuffle
      Gets whether or not the list of watchers to be triggered is shuffled prior to triggering. The default is true.
      Returns:
      whether or not the list of watchers to be triggered is shuffled prior to triggering.
      Default:
      true