public static MetaClassCache getMetaClassCache() { if (cache == null) { cache = CacheUtil.getCache(MetaClassCache.class); } return cache; }
public static MetaClassCache getMetaClassCache() { if (cache == null) { cache = CacheUtil.getCache(MetaClassCache.class); } return cache; }
/** * @return an instance of {@link EnvironmentConfig}. Do NOT retain a reference to this value. Call every time * you need additional configuration information. */ public static EnvironmentConfig getEnvironmentConfig() { return CacheUtil.getCache(EnvironmentConfigCache.class).get(); }
/** * @return an instance of {@link EnvironmentConfig}. Do NOT retain a reference to this value. Call every time * you need additional configuration information. */ public static EnvironmentConfig getEnvironmentConfig() { return CacheUtil.getCache(EnvironmentConfigCache.class).get(); }
public static void clearCache() { CacheUtil.getCache(EnvironmentConfigCache.class).clear(); }
public static void clearCache() { CacheUtil.getCache(EnvironmentConfigCache.class).clear(); }
public String getHashForTypesAnnotatedWith(final String seed, final Class<? extends Annotation> annotation) { if (!CacheUtil.getCache(CacheHolder.class).ANNOTATIONS_TO_CLASS.containsKey(annotation.getName())) { return "0"; } else { try { final MessageDigest md = MessageDigest.getInstance("SHA-256"); if (seed != null) { md.update(seed.getBytes()); } final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); for (final SortableClassFileWrapper classFileWrapper : CacheUtil .getCache(CacheHolder.class).ANNOTATIONS_TO_CLASS.get(annotation.getName())) { byteArrayOutputStream.reset(); final DataOutputStream dataOutputStream = new DataOutputStream(byteArrayOutputStream); classFileWrapper.getClassFile().write(dataOutputStream); dataOutputStream.flush(); md.update(byteArrayOutputStream.toByteArray()); } return RebindUtils.hashToHexString(md.digest()); } catch (final Exception e) { throw new RuntimeException("could not generate hash", e); } } }
public String getHashForTypesAnnotatedWith(final String seed, final Class<? extends Annotation> annotation) { if (!CacheUtil.getCache(CacheHolder.class).ANNOTATIONS_TO_CLASS.containsKey(annotation.getName())) { return "0"; } else { try { final MessageDigest md = MessageDigest.getInstance("SHA-256"); if (seed != null) { md.update(seed.getBytes()); } final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); for (final SortableClassFileWrapper classFileWrapper : CacheUtil .getCache(CacheHolder.class).ANNOTATIONS_TO_CLASS.get(annotation.getName())) { byteArrayOutputStream.reset(); final DataOutputStream dataOutputStream = new DataOutputStream(byteArrayOutputStream); classFileWrapper.getClassFile().write(dataOutputStream); dataOutputStream.flush(); md.update(byteArrayOutputStream.toByteArray()); } return RebindUtils.hashToHexString(md.digest()); } catch (final Exception e) { throw new RuntimeException("could not generate hash", e); } } }
@BeforeClass public static void setup() { CacheUtil.getCache(EnvironmentConfigCache.class).addPermanentFrameworkProperty("errai.ioc.async_bean_manager", "true"); }
@AfterClass public static void tearDown() { CacheUtil.getCache(EnvironmentConfigCache.class).addPermanentFrameworkProperty("errai.ioc.async_bean_manager", "false"); }