Package org.apache.wicket.util.watch

Examples of org.apache.wicket.util.watch.IModificationWatcher


   */
  @Override
  public void internalDestroy()
  {
    // destroy the resource watcher
    IModificationWatcher resourceWatcher = getResourceSettings().getResourceWatcher(false);
    if (resourceWatcher != null)
    {
      resourceWatcher.destroy();
    }

    IFileCleaner fileCleaner = getResourceSettings().getFileCleaner();
    if (fileCleaner != null)
    {
View Full Code Here


        {
          continue;
        }

        // Watch file modifications
        final IModificationWatcher watcher = resourceSettings.getResourceWatcher(true);
        if (watcher != null)
        {
          addToWatcher(path, resourceStream, watcher);
        }
View Full Code Here

   */
  @Override
  public void internalDestroy()
  {
    // destroy the resource watcher
    IModificationWatcher resourceWatcher = getResourceSettings().getResourceWatcher(false);
    if (resourceWatcher != null)
    {
      resourceWatcher.destroy();
    }

    IFileUploadCleaner fileUploadCleaner = getResourceSettings().getFileUploadCleaner();
    if (fileUploadCleaner != null)
    {
View Full Code Here

      // And now remove all watcher entries associated with markup
      // resources no longer in the cache. Note that you can not use
      // Application.get() since removeMarkup() will be called from a
      // ModificationWatcher thread which has no associated Application.
      IModificationWatcher watcher = application.getResourceSettings().getResourceWatcher(
        true);
      if (watcher != null)
      {
        Iterator<IModifiable> iter = watcher.getEntries().iterator();
        while (iter.hasNext())
        {
          IModifiable modifiable = iter.next();
          if (modifiable instanceof MarkupResourceStream)
          {
View Full Code Here

        markupKeyCache.put(cacheKey, locationString);
        return markup;
      }

      // Watch file in the future
      final IModificationWatcher watcher = Application.get()
        .getResourceSettings()
        .getResourceWatcher(true);
      if (watcher != null)
      {
        watcher.add(markupResourceStream, new IChangeListener()
        {
          public void onChange()
          {
            if (log.isDebugEnabled())
            {
              log.debug("Remove markup from cache: " + markupResourceStream);
            }

            // Remove the markup from the cache. It will be reloaded
            // next time when the markup is requested.
            watcher.remove(markupResourceStream);
            removeMarkup(cacheKey);
          }
        });
      }
    }
View Full Code Here

      // And now remove all watcher entries associated with markup
      // resources no longer in the cache. Note that you can not use
      // Application.get() since removeMarkup() will be call from a
      // ModificationWatcher thread which has no associated Application.
      final IModificationWatcher watcher = application.getResourceSettings()
        .getResourceWatcher(true);
      if (watcher != null)
      {
        Iterator<IModifiable> iter = watcher.getEntries().iterator();
        while (iter.hasNext())
        {
          IModifiable modifiable = iter.next();
          if (modifiable instanceof MarkupResourceStream)
          {
View Full Code Here

      {
        markupKeyCache.put(cacheKey, locationString);
        return markup;
      }
      // Watch file in the future
      final IModificationWatcher watcher = Application.get()
        .getResourceSettings()
        .getResourceWatcher(true);
      if (watcher != null)
      {
        watcher.add(markupResourceStream, new IChangeListener()
        {
          public void onChange()
          {
            if (log.isDebugEnabled())
            {
              log.debug("Remove markup from cache: " + markupResourceStream);
            }

            // Remove the markup from the cache. It will be reloaded
            // next time when the markup is requested.
            watcher.remove(markupResourceStream);
            removeMarkup(cacheKey);
          }
        });
      }
    }
View Full Code Here

      return isPlainText() ? "\n\n".getBytes() : new byte[0];
    }

    private void watchForChanges(final List<IResourceStream> resourceStreams) {
      // Watch file in the future
      final IModificationWatcher watcher = Application.get().getResourceSettings().getResourceWatcher(true);
      if (watcher != null) {
        final IChangeListener listener = new IChangeListener() {
          @Override
          public void onChange() {
            log.info("merged resource has changed");
            synchronized (MergedResourceStream.this) {
              for (final IResourceStream resourceStream : resourceStreams) {
                watcher.remove(resourceStream);
              }
              _localizedMergedResourceStream = null;
            }
          }
        };
        for (final IResourceStream resourceStream : resourceStreams) {
          watcher.add(resourceStream, listener);
        }
      }
    }
View Full Code Here

        {
          continue;
        }

        // Watch file modifications
        final IModificationWatcher watcher = context.getResourceWatcher(true);
        if (watcher != null)
        {
          addToWatcher(path, resourceStream, watcher);
        }
View Full Code Here

   */
  @Override
  public void internalDestroy()
  {
    // destroy the resource watcher
    IModificationWatcher resourceWatcher = getResourceSettings().getResourceWatcher(false);
    if (resourceWatcher != null)
    {
      resourceWatcher.destroy();
    }
    super.internalDestroy();
    bufferedResponses.clear();
    getSessionStore().destroy();
    FileCleaner.destroy();
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.watch.IModificationWatcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.