Package cn.bran.play

Examples of cn.bran.play.CacheableRunner


    renderJapid(); //
  }
  public static void authorPanel(final Author a) {
    boolean calledFromView = isInvokedfromJapidView();
    System.out.println("calledFromView: " + calledFromView);
    CacheableRunner r = new CacheableRunner("10s", CacheableRunner.genCacheKey()) {
      @Override
      protected RenderResult render() {
        return new authorPanel().render(a);
      }
    };
   
    throw new JapidResult(r.run());
    //  or     render(r);
  }
View Full Code Here


    renderJapid(a);
  }
 
  public static void cacheWithRenderJapid(final String a) {
//      CacheableRunner r = new CacheableRunner("5s", genCacheKey()) {
    CacheableRunner r = new CacheableRunner("5s") {
      @Override
      protected RenderResult render() {
        System.out.println("rerender...");
        String b = a + new Date().getSeconds();
        return getRenderResultWith("", b);
View Full Code Here

    Map<String, String> map = new HashMap<String, String>();
    map.put("a", "aa");
    map.put("b", "bb");
    StringBuilder sb = new StringBuilder("hello");
    long rt = 1000;
    CacheableRunner cr = new CacheableRunner("1m", "anything") {
      @Override
      protected RenderResult render() {
        return null;
      }
    };
View Full Code Here

  public static void authorPanel2(final Author a) {
    renderJapid(a);
  }
 
  public static void cacheWithRenderJapid(final String a) {
    CacheableRunner r = new CacheableRunner("5s") {
      @Override
      protected RenderResult render() {
        System.out.println("rerender...");
        String b = a + " " + new Date().getSeconds();
        return getRenderResultWith("", b);
View Full Code Here

public class Application extends JapidController {
  public static void index() {
    renderJapid(); // use the default index.html in the japidviews/SampleController directory
  }
  public static void authorPanel(final Author a) {
    CacheableRunner r = new CacheableRunner("10s", genCacheKey()) {
      @Override
      protected RenderResult render() {
        return new authorPanel().render(a);
      }
    };
   
    throw new JapidResult(r.run());
    //  or     render(r);
  }
View Full Code Here

    renderJapid(a);
  }
 
  public static void cacheWithRenderJapid(final String a) {
//      CacheableRunner r = new CacheableRunner("5s", genCacheKey()) {
    CacheableRunner r = new CacheableRunner("5s") {
      @Override
      protected RenderResult render() {
        System.out.println("rerender...");
        String b = a + new Date().getSeconds();
        return getRenderResultWith("", b);
View Full Code Here

TOP

Related Classes of cn.bran.play.CacheableRunner

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.