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

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

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

Ehcache.setNodeCoherent介绍

[英]Sets the cache in coherent or incoherent mode depending on the parameter on this node. Calling setNodeCoherent(true) when the cache is already in coherent mode or calling setNodeCoherent(false) when already in incoherent mode will be a no-op.

It applies to coherent clustering mechanisms only e.g. Terracotta

When using Terracotta clustered caches with nonstop enabled, the timeout used by this method is NonstopConfiguration#getBulkOpsTimeoutMultiplyFactor() times the timeout value in the config.
[中]根据此节点上的参数,将缓存设置为相干或非相干模式。当缓存已经处于相干模式时调用SetNode相干(true),或者当缓存已经处于非相干模式时调用SetNode相干(false)将是不可操作的。
它仅适用于相干聚集机制,例如Terracotta
当使用启用了不间断的Terracotta群集缓存时,此方法使用的超时是NonSopConfiguration#getBulkOpsTimeoutMultiplyFactor()乘以配置中的超时值。

代码示例

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

/**
 * {@inheritDoc}
 *
 * @deprecated Use {@link #setNodeBulkLoadEnabled(boolean)} instead
 */
@Deprecated
public void setNodeCoherent(boolean coherent) throws UnsupportedOperationException {
  underlyingCache.setNodeCoherent(coherent);
}

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

/**
* {@inheritDoc}
*/
public void setNodeCoherent(boolean arg0) throws UnsupportedOperationException, TerracottaNotRunningException {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    this.cache.setNodeCoherent(arg0);
  } finally {
    t.setContextClassLoader(prev);
  }
}

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

/**
 * {@inheritDoc}
 *
 * @deprecated use {@link #setNodeBulkLoadEnabled(boolean)} instead
 */
@Deprecated
public void setNodeCoherent(boolean coherent) {
  boolean isNodeCoherent = isNodeCoherent();
  if (coherent != isNodeCoherent) {
    if (!coherent && getTransactional()) {
      LOG.warn("a transactional cache cannot be incoherent");
      return;
    }
    try {
      sampledCacheDelegate.getCache().setNodeCoherent(coherent);
    } catch (RuntimeException e) {
      throw Utils.newPlainException(e);
    }
  }
}

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

/**
 * {@inheritDoc}
 */
public void setNodeCoherent(boolean coherent)
    throws UnsupportedOperationException {
  cache.setNodeCoherent(coherent);
}

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

/**
 * {@inheritDoc}
 *
 * @deprecated Use {@link #setNodeBulkLoadEnabled(boolean)} instead
 */
@Deprecated
public void setNodeCoherent(boolean coherent) throws UnsupportedOperationException {
  underlyingCache.setNodeCoherent(coherent);
}

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

/**
 * {@inheritDoc}
 *
 * @deprecated Use {@link #setNodeBulkLoadEnabled(boolean)} instead
 */
@Deprecated
public void setNodeCoherent(boolean coherent) throws UnsupportedOperationException {
  underlyingCache.setNodeCoherent(coherent);
}

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

/**
 * {@inheritDoc}
 *
 * @deprecated Use {@link #setNodeBulkLoadEnabled(boolean)} instead
 */
@Deprecated
public void setNodeCoherent(boolean coherent) throws UnsupportedOperationException {
  underlyingCache.setNodeCoherent(coherent);
}

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

/**
* {@inheritDoc}
*/
public void setNodeCoherent(boolean arg0) throws UnsupportedOperationException, TerracottaNotRunningException {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    this.cache.setNodeCoherent(arg0);
  } finally {
    t.setContextClassLoader(prev);
  }
}

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

/**
* {@inheritDoc}
*/
public void setNodeCoherent(boolean arg0) throws UnsupportedOperationException, TerracottaNotRunningException {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    this.cache.setNodeCoherent(arg0);
  } finally {
    t.setContextClassLoader(prev);
  }
}

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

/**
* {@inheritDoc}
*/
public void setNodeCoherent(boolean arg0) throws UnsupportedOperationException, TerracottaNotRunningException {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    this.cache.setNodeCoherent(arg0);
  } finally {
    t.setContextClassLoader(prev);
  }
}

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

/**
 * {@inheritDoc}
 *
 * @deprecated use {@link #setNodeBulkLoadEnabled(boolean)} instead
 */
@Deprecated
public void setNodeCoherent(boolean coherent) {
  boolean isNodeCoherent = isNodeCoherent();
  if (coherent != isNodeCoherent) {
    if (!coherent && getTransactional()) {
      LOG.warn("a transactional cache cannot be incoherent");
      return;
    }
    try {
      sampledCacheDelegate.getCache().setNodeCoherent(coherent);
    } catch (RuntimeException e) {
      throw Utils.newPlainException(e);
    }
  }
}

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

/**
 * {@inheritDoc}
 *
 * @deprecated use {@link #setNodeBulkLoadEnabled(boolean)} instead
 */
@Deprecated
public void setNodeCoherent(boolean coherent) {
  boolean isNodeCoherent = isNodeCoherent();
  if (coherent != isNodeCoherent) {
    if (!coherent && getTransactional()) {
      LOG.warn("a transactional cache cannot be incoherent");
      return;
    }
    try {
      sampledCacheDelegate.getCache().setNodeCoherent(coherent);
    } catch (RuntimeException e) {
      throw Utils.newPlainException(e);
    }
  }
}

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

/**
 * {@inheritDoc}
 *
 * @deprecated use {@link #setNodeBulkLoadEnabled(boolean)} instead
 */
@Deprecated
public void setNodeCoherent(boolean coherent) {
  boolean isNodeCoherent = isNodeCoherent();
  if (coherent != isNodeCoherent) {
    if (!coherent && getTransactional()) {
      LOG.warn("a transactional cache cannot be incoherent");
      return;
    }
    try {
      sampledCacheDelegate.getCache().setNodeCoherent(coherent);
    } catch (RuntimeException e) {
      throw Utils.newPlainException(e);
    }
  }
}

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.0

private void shutdownRegisteredCaches() {
 debug("Shutting down registered ehcaches...");
 shutdownInProgress = true;
 for (Ehcache cache : registeredCaches) {
  if (!cache.isNodeCoherent()) {
   debug("Setting cache coherent: " + cache.getName());
   cache.setNodeCoherent(true);
  } else {
   debug("Cache is already coherent: " + cache.getName());
  }
 }
 debug("Completed shutting down ehcaches.");
}

相关文章

Ehcache类方法