Skip to content

Instantly share code, notes, and snippets.

Created December 17, 2012 16:31
Show Gist options
  • Save anonymous/aab5992ab4cf5d22b2d3 to your computer and use it in GitHub Desktop.
Save anonymous/aab5992ab4cf5d22b2d3 to your computer and use it in GitHub Desktop.
@Inherited
@ViewMetaData(override = true)
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface HttpCache
{
HttpCacheType value();
int unit();
String time();
}
public enum HttpCacheType
{
NEVER,
MINUTES,
HOURS,
DAYS,
MANUAL
}
@Page(basePath = "/")
public interface TestViewConfig extends ViewConfig
{
@Page
@HttpCache(value = HttpCacheType.NEVER) // no cache
class ViewB implements TestViewConfig { }
@Page
@HttpCache(value = HttpCacheType.HOURS, unit = 1) // cache now + 1 hour
class ViewA implements TestViewConfig { }
@Page
@HttpCache(value = HttpCacheType.MANUAL, time = "23:59:59") // cache till today 23:59:99
class ViewC implements TestViewConfig { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment