@Override public boolean isStoreByValue() { CopierConfiguration copierConfig = findSingletonAmongst( CopierConfiguration.class, cacheConfiguration.getServiceConfigurations()); return copierConfig != null; }
private static <K, V> boolean isStoreByValue( Configuration<K, V> config, CacheConfiguration<K, V> ehcacheConfig) { if (ehcacheConfig != null) { Collection<ServiceConfiguration<?>> serviceConfigurations = ehcacheConfig.getServiceConfigurations(); for (ServiceConfiguration<?> serviceConfiguration : serviceConfigurations) { if (serviceConfiguration instanceof DefaultCopierConfiguration) { DefaultCopierConfiguration copierConfig = (DefaultCopierConfiguration) serviceConfiguration; if (copierConfig.getType().equals(DefaultCopierConfiguration.Type.VALUE)) { if (copierConfig.getClazz().isAssignableFrom(IdentityCopier.class)) { return false; } else { return true; } } } } } return config.isStoreByValue(); }
@Override public Class<V> getValueType() { return cacheConfiguration.getValueType(); }
@Override public Class<K> getKeyType() { return cacheConfiguration.getKeyType(); }