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

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

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

Ehcache.clone介绍

[英]Clones a cache. This is only legal if the cache has not been initialized. At that point only primitives have been set and no net.sf.ehcache.store.MemoryStore or net.sf.ehcache.store.disk.DiskStore has been created.

A new, empty, RegisteredEventListeners is created on clone.
[中]克隆缓存。这仅在缓存尚未初始化时才合法。此时,只设置了基本体,没有网络。旧金山。ehcache。百货商店记忆存储或网络。旧金山。ehcache。百货商店磁盘已创建DiskStore。
将在克隆上创建一个新的空RegisteredEventListeners。

代码示例

代码示例来源:origin: AxonFramework/AxonFramework

  1. @Override
  2. public CacheEventListenerAdapter clone() throws CloneNotSupportedException {
  3. CacheEventListenerAdapter clone = (CacheEventListenerAdapter) super.clone();
  4. clone.ehCache = (Ehcache) ehCache.clone();
  5. clone.delegate = (EntryListener) delegate.clone();
  6. return clone;
  7. }
  8. }

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

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

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

  1. private Ehcache cloneDefaultCache(final String cacheName) {
  2. if (defaultCache == null) {
  3. return null;
  4. }
  5. Ehcache cache;
  6. try {
  7. cache = (Ehcache) defaultCache.clone();
  8. } catch (CloneNotSupportedException e) {
  9. throw new CacheException("Failure cloning default cache. Initial cause was " + e.getMessage(), e);
  10. }
  11. if (cache != null) {
  12. cache.setName(cacheName);
  13. }
  14. return cache;
  15. }

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

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

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

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

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

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

代码示例来源:origin: org.axonframework/axon-core

  1. @Override
  2. public CacheEventListenerAdapter clone() throws CloneNotSupportedException {
  3. CacheEventListenerAdapter clone = (CacheEventListenerAdapter) super.clone();
  4. clone.ehCache = (Ehcache) ehCache.clone();
  5. clone.delegate = (EntryListener) delegate.clone();
  6. return clone;
  7. }
  8. }

代码示例来源:origin: org.axonframework/axon-messaging

  1. @Override
  2. public CacheEventListenerAdapter clone() throws CloneNotSupportedException {
  3. CacheEventListenerAdapter clone = (CacheEventListenerAdapter) super.clone();
  4. clone.ehCache = (Ehcache) ehCache.clone();
  5. clone.delegate = (EntryListener) delegate.clone();
  6. return clone;
  7. }
  8. }

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

  1. private Ehcache cloneDefaultCache(final String cacheName) {
  2. if (defaultCache == null) {
  3. return null;
  4. }
  5. Ehcache cache;
  6. try {
  7. cache = (Ehcache) defaultCache.clone();
  8. } catch (CloneNotSupportedException e) {
  9. throw new CacheException("Failure cloning default cache. Initial cause was " + e.getMessage(), e);
  10. }
  11. if (cache != null) {
  12. cache.setName(cacheName);
  13. }
  14. return cache;
  15. }

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

  1. private Ehcache cloneDefaultCache(final String cacheName) {
  2. if (defaultCache == null) {
  3. return null;
  4. }
  5. Ehcache cache;
  6. try {
  7. cache = (Ehcache) defaultCache.clone();
  8. } catch (CloneNotSupportedException e) {
  9. throw new CacheException("Failure cloning default cache. Initial cause was " + e.getMessage(), e);
  10. }
  11. if (cache != null) {
  12. cache.setName(cacheName);
  13. }
  14. return cache;
  15. }

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

  1. private Ehcache cloneDefaultCache(final String cacheName) {
  2. if (defaultCache == null) {
  3. return null;
  4. }
  5. Ehcache cache;
  6. try {
  7. cache = (Ehcache) defaultCache.clone();
  8. } catch (CloneNotSupportedException e) {
  9. throw new CacheException("Failure cloning default cache. Initial cause was " + e.getMessage(), e);
  10. }
  11. if (cache != null) {
  12. cache.setName(cacheName);
  13. }
  14. return cache;
  15. }

相关文章

Ehcache类方法