Examples of expires()


Examples of com.feth.play.module.pa.user.AuthUser.expires()

    // User logged in once more - wanna make some updates?
    final AuthUser u = getUserService().update(authUser);

    session.put(PlayAuthenticate.USER_KEY, u.getId());
    session.put(PlayAuthenticate.PROVIDER_KEY, u.getProvider());
    if (u.expires() != AuthUser.NO_EXPIRATION) {
      session.put(EXPIRES_KEY, Long.toString(u.expires()));
    } else {
      session.remove(EXPIRES_KEY);
    }
  }
View Full Code Here

Examples of com.feth.play.module.pa.user.AuthUser.expires()

    final AuthUser u = getUserService().update(authUser);

    session.put(PlayAuthenticate.USER_KEY, u.getId());
    session.put(PlayAuthenticate.PROVIDER_KEY, u.getProvider());
    if (u.expires() != AuthUser.NO_EXPIRATION) {
      session.put(EXPIRES_KEY, Long.toString(u.expires()));
    } else {
      session.remove(EXPIRES_KEY);
    }
  }
View Full Code Here

Examples of com.pccw.hessian.support.cache.CachePolicy.expires()

 
  //不需要判断policy为null,policy为null,认定为不适用缓存,不会掉用此方法
  @Override
  public boolean ifReturnFromCahce(Method method, Object[] args) {
    CachePolicy policy=method.getAnnotation(CachePolicy.class);
    if(policy.expires() < 0){
      System.out.println("没有有效期,false");
      return false;
    }
    try {
      String key=getCacheKey(method,args);
View Full Code Here

Examples of com.pccw.hessian.support.cache.CachePolicy.expires()

      //String key=policy.keyGenerater().newInstance().generatKey(method, args);System.out.println("生成的缓存key:"+key);
      if(cache.containsKey(key)==false){System.out.println("有缓存规则,但缓存中不存在false");
        return false;
      }
      CacheContainner cc=cache.get(key);
      if((System.currentTimeMillis()-cc.brith) < policy.expires()){System.out.println("有缓存规则,且缓存中存在,且没过期true");
        return true;
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

Examples of javax.ws.rs.core.Response.ResponseBuilder.expires()

    cacheControl.setPrivate(false);
    builder.cacheControl(cacheControl);

    Calendar calendar = Calendar.getInstance();
    calendar.add(Calendar.MONTH, 1);
    builder.expires(calendar.getTime());
    builder.lastModified(CommaFeedApplication.STARTUP_TIME);

    return builder.build();
  }
View Full Code Here

Examples of net.sourceforge.stripes.action.HttpCache.expires()

                    .getName(), ".", handler.getName(), "()");
            HttpCache annotation = getAnnotation(handler, beanClass);
            if (annotation != null) {
                HttpServletResponse response = ctx.getActionBeanContext().getResponse();
                if (annotation.allow()) {
                    long expires = annotation.expires();
                    if (expires != HttpCache.DEFAULT_EXPIRES) {
                        logger.debug("Response expires in ", expires, " seconds");
                        expires = expires * 1000 + System.currentTimeMillis();
                        response.setDateHeader("Expires", expires);
                    }
View Full Code Here

Examples of net.sourceforge.stripes.action.HttpCache.expires()

        // check for weirdness
        if (annotation != null) {
            logger.debug("Found ", HttpCache.class.getSimpleName(), " for ", beanClass.getName(),
                    ".", method.getName(), "()");
            int expires = annotation.expires();
            if (annotation.allow() && expires != HttpCache.DEFAULT_EXPIRES && expires < 0) {
                logger.warn(HttpCache.class.getSimpleName(), " for ", beanClass.getName(), ".",
                        method.getName(), "() allows caching but expires in the past");
            }
            else if (!annotation.allow() && expires != HttpCache.DEFAULT_EXPIRES) {
View Full Code Here

Examples of net.sourceforge.stripes.action.HttpCache.expires()

                    .getName(), ".", handler.getName(), "()");
            HttpCache annotation = getAnnotation(handler, beanClass);
            if (annotation != null) {
                HttpServletResponse response = ctx.getActionBeanContext().getResponse();
                if (annotation.allow()) {
                    long expires = annotation.expires();
                    if (expires != HttpCache.DEFAULT_EXPIRES) {
                        logger.debug("Response expires in ", expires, " seconds");
                        expires = expires * 1000 + System.currentTimeMillis();
                        response.setDateHeader("Expires", expires);
                    }
View Full Code Here

Examples of net.sourceforge.stripes.action.HttpCache.expires()

        // check for weirdness
        if (annotation != null) {
            logger.debug("Found ", HttpCache.class.getSimpleName(), " for ", beanClass.getName(),
                    ".", method.getName(), "()");
            int expires = annotation.expires();
            if (annotation.allow() && expires != HttpCache.DEFAULT_EXPIRES && expires < 0) {
                logger.warn(HttpCache.class.getSimpleName(), " for ", beanClass.getName(), ".",
                        method.getName(), "() allows caching but expires in the past");
            }
            else if (!annotation.allow() && expires != HttpCache.DEFAULT_EXPIRES) {
View Full Code Here

Examples of net.sourceforge.stripes.action.HttpCache.expires()

                    beanClass.getName(), ".", handler.getName(), "()");
            final HttpCache annotation = getAnnotation(handler, beanClass);
            if (annotation != null) {
                final HttpServletResponse response = ctx.getActionBeanContext().getResponse();
                if (annotation.allow()) {
                    long expires = annotation.expires();
                    if (expires != HttpCache.DEFAULT_EXPIRES) {
                        logger.debug("Response expires in ", expires, " seconds");
                        expires = expires * 1000 + System.currentTimeMillis();
                        response.setDateHeader("Expires", expires);
                    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.