Skip to content
martin-g edited this page Mar 28, 2012 · 2 revisions

Wicket7 Project

The Wicket7 project provides implementations of Wicket core interfaces based on JDK7 goodies.

Nio2ModificationWatcher

This is an extension of the standard org.apache.wicket.util.watch.ModificationWatcher that adds the ability to be notified when a new file appears in the classpath.

Use case

If org.apache.wicket.markup.MarkupCache is asked for a markup file (e.g. .html) and this file doesn't exists then it will add a special entry in its internal cache implementation that will mark this markup file as not existing and next request for this markup file will use that entry in the cache and wont check in the file system. If later the developer provides this markup file he needs to notify MarkupCache about it. Until now the only way is to clear the whole MarkupCache through JMX.

Solution

org.wicketstuff.wicket7.util.watch.Nio2ModificationWatcher uses JDK7 NIO2 to watch the classpath for newly created files. Upon notification it invalidates the entry in the MarkupCache.

Setup

    public class MyApplication extends WebApplication {
        protected void init() {
            super.init();

            getResourceSettings().setResourceWatcher(new Nio2ModificationWatcher(this));
        }
    }

Maven Artifacts

  • wicketstuff-wicket7

Documentation

Maven Stable

There is no maven stable build yet.

Maven Development

<dependency>
    <groupId>org.wicketstuff</groupId>
    <artifactId>wicketstuff-wicket7</artifactId>
    <version>6.0-SNAPSHOT</version>
</dependency>

<repository>
	<id>wicketstuff-core-snapshots</id>
	<url>ttps://oss.sonatype.org/content/repositories/snapshots</url>
	<snapshots>
		<enabled>true</enabled>
	</snapshots>		
</repository>

License

Apache 2.0.

Clone this wiki locally