org.appng.core.controller

## Class RepositoryWatcher

- java.lang.Object
- - org.appng.core.controller.RepositoryWatcher

- All Implemented Interfaces:
    Runnable

      public class RepositoryWatcher
      extends Object
      implements Runnable

  A service that watches for modified/deleted files in a `Site`'s www-directory (see `SiteProperties.WWW_DIR`) using a `WatchService`.

  If caching for the site is active (see `SiteProperties.CACHE_ENABLED`), cache entries for the modified/deleted files are removed from the cache. Since there could be some forwarding rules defined in the site's `urlrewrite.xml`, it is also necessary to parse these rules and remove the 'aliases' from the cache.
  Author:
    Matthias Müller

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DEFAULT_RULE_SUFFIX`
    `protected Long` | `forwardsUpdatedAt`
    `protected AtomicLong` | `numEvents`
    `protected AtomicLong` | `numOverflows`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RepositoryWatcher(Site site, String jspExtension, String ruleSourceSuffix)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `needsToBeWatched()`
    `void` | `run()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_RULE_SUFFIX

          public static final String DEFAULT_RULE_SUFFIX

      See Also:
        Constant Field Values

    - #### forwardsUpdatedAt

          protected Long forwardsUpdatedAt

    - #### numEvents

          protected AtomicLong numEvents

    - #### numOverflows

          protected AtomicLong numOverflows

  - ### Constructor Detail

    - #### RepositoryWatcher

          public RepositoryWatcher(Site site,
                                   String jspExtension,
                                   String ruleSourceSuffix)

  - ### Method Detail

    - #### run

          public void run()

      Specified by:
        `run` in interface `Runnable`

    - #### needsToBeWatched

          public boolean needsToBeWatched()

Copyright © 2011–2023 aiticon GmbH. All rights reserved.