net.sf.ehcache.Ehcache.isExpired()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(210)

本文整理了Java中net.sf.ehcache.Ehcache.isExpired()方法的一些代码示例,展示了Ehcache.isExpired()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ehcache.isExpired()方法的具体详情如下:
包路径:net.sf.ehcache.Ehcache
类名称:Ehcache
方法名:isExpired

Ehcache.isExpired介绍

[英]Checks whether this cache element has expired.

The element is expired if:

  1. the idle time is non-zero and has elapsed, unless the cache is eternal; or
  2. the time to live is non-zero and has elapsed, unless the cache is eternal; or
  3. the value of the element is null.
    [中]检查此缓存元素是否已过期。
    如果出现以下情况,元素将过期:
    1.空闲时间非零且已过,除非缓存是永久的;或
    1.生存时间非零且已过,除非缓存是永恒的;或
    1.元素的值为空。

代码示例

代码示例来源:origin: net.sf.ehcache/ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public boolean isExpired(Element element) throws IllegalStateException, NullPointerException {
  5. return underlyingCache.isExpired(element);
  6. }

代码示例来源:origin: net.sf.ehcache/ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public boolean isExpired(Element arg0) throws IllegalStateException, NullPointerException {
  5. // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  6. Thread t = Thread.currentThread();
  7. ClassLoader prev = t.getContextClassLoader();
  8. t.setContextClassLoader(this.classLoader);
  9. try {
  10. return this.cache.isExpired(arg0);
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public boolean isExpired(Element element) throws IllegalStateException, NullPointerException {
  5. return underlyingCache.isExpired(element);
  6. }

代码示例来源:origin: net.sf.ehcache.internal/ehcache-core

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public boolean isExpired(Element element) throws IllegalStateException, NullPointerException {
  5. return underlyingCache.isExpired(element);
  6. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public boolean isExpired(Element element) throws IllegalStateException, NullPointerException {
  5. return underlyingCache.isExpired(element);
  6. }

代码示例来源:origin: net.sf.ehcache/ehcache-explicitlocking

  1. /**
  2. * Checks whether this cache element has expired.
  3. * <p/>
  4. * The element is expired if:
  5. * <ol>
  6. * <li>the idle time is non-zero and has elapsed, unless the cache is eternal; or
  7. * <li>the time to live is non-zero and has elapsed, unless the cache is eternal; or
  8. * <li>the value of the element is null.
  9. * </ol>
  10. *
  11. * @return true if it has expired
  12. * @throws IllegalStateException
  13. * if the cache is not {@link net.sf.ehcache.Status#STATUS_ALIVE}
  14. * @throws NullPointerException
  15. * if the element is null
  16. */
  17. public boolean isExpired(Element element) throws IllegalStateException, NullPointerException {
  18. return cache.isExpired(element);
  19. }

代码示例来源:origin: net.sf.ehcache.internal/ehcache-core

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public boolean isExpired(Element arg0) throws IllegalStateException, NullPointerException {
  5. // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  6. Thread t = Thread.currentThread();
  7. ClassLoader prev = t.getContextClassLoader();
  8. t.setContextClassLoader(this.classLoader);
  9. try {
  10. return this.cache.isExpired(arg0);
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public boolean isExpired(Element arg0) throws IllegalStateException, NullPointerException {
  5. // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  6. Thread t = Thread.currentThread();
  7. ClassLoader prev = t.getContextClassLoader();
  8. t.setContextClassLoader(this.classLoader);
  9. try {
  10. return this.cache.isExpired(arg0);
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public boolean isExpired(Element arg0) throws IllegalStateException, NullPointerException {
  5. // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  6. Thread t = Thread.currentThread();
  7. ClassLoader prev = t.getContextClassLoader();
  8. t.setContextClassLoader(this.classLoader);
  9. try {
  10. return this.cache.isExpired(arg0);
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

代码示例来源:origin: apache/cxf

  1. public SecurityToken getToken(String identifier) {
  2. if (cache == null) {
  3. return null;
  4. }
  5. Element element = cache.get(identifier);
  6. if (element != null && !cache.isExpired(element)) {
  7. return (SecurityToken)element.getObjectValue();
  8. }
  9. return null;
  10. }

代码示例来源:origin: org.apache.cxf/cxf-rt-ws-security

  1. public SecurityToken getToken(String identifier) {
  2. if (cache == null) {
  3. return null;
  4. }
  5. Element element = cache.get(identifier);
  6. if (element != null && !cache.isExpired(element)) {
  7. return (SecurityToken)element.getObjectValue();
  8. }
  9. return null;
  10. }

代码示例来源:origin: com.madgag/mini-git-server-server

  1. public boolean isExpired(Element element) throws IllegalStateException,
  2. NullPointerException {
  3. return self().isExpired(element);
  4. }

代码示例来源:origin: rtyley/mini-git-server

  1. public boolean isExpired(Element element) throws IllegalStateException,
  2. NullPointerException {
  3. return self().isExpired(element);
  4. }

代码示例来源:origin: apache/cxf

  1. public ResponseState getResponseState(String securityContextKey) {
  2. Element element = responseCache.get(securityContextKey);
  3. if (element != null) {
  4. if (responseCache.isExpired(element)) {
  5. responseCache.remove(securityContextKey);
  6. return null;
  7. }
  8. return (ResponseState)element.getObjectValue();
  9. }
  10. return null;
  11. }

代码示例来源:origin: apache/cxf

  1. @SuppressWarnings("unchecked")
  2. @ManagedOperation()
  3. @Override
  4. public Map<String, String> get(String user, String realm) {
  5. Element element = cache.get(user + "@" + realm);
  6. if (element != null && !cache.isExpired(element)) {
  7. return (Map<String, String>)element.getObjectValue();
  8. }
  9. return null;
  10. }

代码示例来源:origin: org.apache.cxf.services.sts/cxf-services-sts-core

  1. @SuppressWarnings("unchecked")
  2. @ManagedOperation()
  3. @Override
  4. public Map<String, String> get(String user, String realm) {
  5. Element element = cache.get(user + "@" + realm);
  6. if (element != null && !cache.isExpired(element)) {
  7. return (Map<String, String>)element.getObjectValue();
  8. }
  9. return null;
  10. }

代码示例来源:origin: apache/cxf

  1. /**
  2. * Return the given identifier if it is contained in the cache, otherwise null.
  3. * @param id The identifier to check
  4. */
  5. public String getId(String id) {
  6. Element element = cache.get(id);
  7. if (element != null) {
  8. if (cache.isExpired(element)) {
  9. cache.remove(id);
  10. return null;
  11. }
  12. return (String)element.getObjectValue();
  13. }
  14. return null;
  15. }

代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-common

  1. /**
  2. * Return true if the given identifier is contained in the cache
  3. * @param identifier The identifier to check
  4. */
  5. public boolean contains(String identifier) {
  6. if (cache == null) {
  7. return false;
  8. }
  9. Element element = cache.get(identifier);
  10. if (element != null) {
  11. if (cache.isExpired(element)) {
  12. cache.remove(identifier);
  13. return false;
  14. }
  15. return true;
  16. }
  17. return false;
  18. }

相关文章

Ehcache类方法