获取真实的缓存时间值

@param expire           缓存时间
@param expireExpression 缓存时间表达式
@param arguments        方法参数
@param result           方法执行返回结果
@return real expire
@throws Exception 异常
975006
public int getRealExpire(int expire, String expireExpression, Object[] arguments, Object result) throws Exception {
        Integer tmpExpire = null;
        if (null != expireExpression && expireExpression.length() > 0) {
            tmpExpire = this.getElValue(expireExpression, null, arguments, result, true, Integer.class);
            if (null != tmpExpire && tmpExpire.intValue() >= 0) {
                // 返回缓存时间表达式计算的时间
                return tmpExpire.intValue();
            }
        }
        return expire;
    }
897721
function computeExpires(str) {
  const lastCh = str.charAt(str.length - 1);
  const value = parseInt(str, 10);
  let expires = new Date();

  switch (lastCh) {
    case 'Y': expires.setFullYear(expires.getFullYear() + value); break;
    case 'M': expires.setMonth(expires.getMonth() + value); break;
    case 'D': expires.setDate(expires.getDate() + value); break;
    case 'h': expires.setHours(expires.getHours() + value); break;
    case 'm': expires.setMinutes(expires.getMinutes() + value); break;
    case 's': expires.setSeconds(expires.getSeconds() + value); break;
    default: expires = new Date(str);
  }

  return expires;
}
328207
public com.google.protobuf.Duration getExpiration() {
    return expiration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : expiration_;
  }
260068
protected final Date getExpiration(RenderRequest renderRequest) {
        // Expiration of the JWT
        final PortletSession portletSession = renderRequest.getPortletSession();
        final Date rslt =
                new Date(
                        portletSession.getLastAccessedTime()
                                + ((long) portletSession.getMaxInactiveInterval() * 1000L));
        return rslt;
    }
594172
def expire(self, key, timeout):
        
        if isinstance(timeout, float):
            return self.pexpire(key, int(timeout * 1000))
        if not isinstance(timeout, int):
            raise TypeError(
                "timeout argument must be int, not {!r}".format(timeout))
        fut = self.execute(b'EXPIRE', key, timeout)
        return wait_convert(fut, bool)
835465
public void expire() {
        synchronized (this) {
            expired = true;
        }
        int i = loadCount.get();
        debug(String.format("expire jar provider loader for: %s (loadCount: %d)", pluginJar, i));
        if (i <= 0) {
            try {
                close();
            } catch (IOException e) {

            }
        }
    }
370874
public static void main(String... args) throws Exception {

        String string = "SELECT :expr1, #($expr2.class),"
                + " WHERE #if(:expr3) {e = $expr3} #else {e IS NULL}"
                + "#for(variant in $expr4.bytes) { AND c = :variant}" // NL
                + " {AND d = :expr-5}? {AND f = $expr6}?" // NL
                + " BY #!(:expr7) ASC";

        // 在输入中查找  PREFIX 字符
        Matcher matcher = PATTERN_KEYWORD.matcher(string);

        int position = 0;

        while (matcher.find(position)) {

            System.out.println("===============================");
            System.out.println("group 0: " + matcher.group(0));
            System.out.println("group 1: " + matcher.group(1));
            System.out.println("group 2: " + matcher.group(2));
            System.out.println("group 3: " + matcher.group(3));

            position = matcher.end();
        }

        // 在循环表达式中查找
        matcher = PATTERN_IN.matcher("variant in :expr5");

        if (matcher.matches()) {

            System.out.println("===============================");
            System.out.println("group 0: " + matcher.group(0));
            System.out.println("group 1: " + matcher.group(1));
            System.out.println("group 2: " + matcher.group(2));
        }

        // 编译下列语句
        ExqlPattern pattern = new ExqlCompiler(string).compile();

        ExqlContext context = new ExqlContextImpl();

        HashMap<String, Object> map = new HashMap<String, Object>();

        map.put("expr1", "expr1");
        map.put("expr2", "expr2");
        map.put("expr3", "expr3");
        map.put("expr4", "expr4");
        map.put("expr5", "expr5");
        // map.put("expr6", "expr6");
        map.put("expr7", "expr7");

        pattern.execute(context, map, map);
        System.out.println(context.flushOut());
        System.out.println(Arrays.toString(context.getArgs()));
    }
432046
public StoredChannel setExpiration(Long expiration) {
    lock.lock();
    try {
      this.expiration = expiration;
    } finally {
      lock.unlock();
    }
    return this;
  }
397226
@Override
    public void expire(K key, V val) {
        if (val == null) {
            return;
        }
        try {
            TupleInfo tupleInfo = (TupleInfo) val;
            FailSpoutMsg fail = new FailSpoutMsg(key, spout, tupleInfo, taskStats);

            disruptorEventQueue.publish(fail);
        } catch (Exception e) {
            LOG.error("expire error", e);
        }
    }
490496
void expireAfterAccess(String key, @Nullable String value) {
    requireArgument(expireAfterAccessDuration == UNSET_INT, "expireAfterAccess was already set");
    expireAfterAccessDuration = parseDuration(key, value);
    expireAfterAccessTimeUnit = parseTimeUnit(key, value);
  }
882328
private static Date getExpireAt(final Ticket ticket) {
        val expirationPolicy = ticket.getExpirationPolicy();
        val ttl = ticket instanceof TicketState
            ? expirationPolicy.getTimeToLive((TicketState) ticket)
            : expirationPolicy.getTimeToLive();

        if (ttl < 1) {
            return null;
        }

        return new Date(System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(ttl));
    }
283290
private void executeResult() throws Exception {
		result = createResult();

		String timerKey = "executeResult: " + getResultCode();
		try {
			UtilTimerStack.push(timerKey);
			if (result != null) {
				result.execute(this);
			} else if (resultCode != null && !Action.NONE.equals(resultCode)) {
				throw new ConfigurationException("No result defined for action " + getAction().getClass().getName()
						+ " and result " + getResultCode(), proxy.getConfig());
			} else {
				if (LOG.isDebugEnabled()) {
					LOG.debug("No result returned for action " + getAction().getClass().getName() + " at "
							+ proxy.getConfig().getLocation());
				}
			}
		} finally {
			UtilTimerStack.pop(timerKey);
		}
	}
494984
public OneStepDistributedRowLock<K, C> expireLockAfter(long timeout, TimeUnit unit) {
        this.timeout      = timeout;
        this.timeoutUnits = unit;
        return this;
    }
661060
public CacheConfigurationBuilder<K, V> withExpiry(ExpiryPolicy<? super K, ? super V> expiry) {
    if (expiry == null) {
      throw new NullPointerException("Null expiry");
    }
    CacheConfigurationBuilder<K, V> otherBuilder = new CacheConfigurationBuilder<>(this);
    otherBuilder.expiry = expiry;
    return otherBuilder;
  }
962598
@Override
    public final void expirerStop()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "expirerStop");

        _expirer.stop();

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "expirerStop");
    }
1318812
public boolean expire(boolean cancelTimer)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "expire", new Boolean(cancelTimer));

    if ((expiryHandle != null) && cancelTimer)
    {
      expiryHandle.cancel();
    }
    expiryHandle = null;
    if (!satisfied)
    {
      expired = true;
      if (TraceComponent.isAnyTracingEnabled() && UserTrace.tc_mt.isDebugEnabled())    
        SibTr.debug(UserTrace.tc_mt,       
           nls_mt.getFormattedMessage(
           "REMOTE_REQUEST_EXPIRED_CWSJU0033",
           new Object[] {
             tick},
           null));
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "expire", new Boolean(expired));

    return expired;
  }
974508
public ColumnPrefixDistributedRowLock<K> expireLockAfter(long timeout, TimeUnit unit) {
        this.timeout      = timeout;
        this.timeoutUnits = unit;
        return this;
    }