use of org.glassfish.internal.api.JavaEEContextUtil in project Payara by payara.
the class CacheManagerProxy method getCache.
@Override
public <K, V> Cache<K, V> getCache(String cacheName, Class<K> keyType, Class<V> valueType) {
JavaEEContextUtil ctxUtil = serverContext.getDefaultServices().getService(JavaEEContextUtil.class);
Cache<K, V> cache = delegate.getCache(cacheName, keyType, valueType);
return cache != null ? new CacheProxy<>(cache, ctxUtil) : null;
}
use of org.glassfish.internal.api.JavaEEContextUtil in project Payara by payara.
the class CacheManagerProxy method createCache.
@Override
public <K, V, C extends Configuration<K, V>> Cache<K, V> createCache(String string, C config) throws IllegalArgumentException {
Cache<K, V> cache;
JavaEEContextUtil ctxUtil = serverContext.getDefaultServices().getService(JavaEEContextUtil.class);
if (ctxUtil != null && config instanceof CompleteConfiguration) {
CompleteConfiguration<K, V> cfg = new CompleteConfigurationProxy<>((CompleteConfiguration<K, V>) config, ctxUtil);
cache = delegate.createCache(string, cfg);
} else {
cache = delegate.createCache(string, config);
}
return ctxUtil != null ? new CacheProxy<>(cache, ctxUtil) : cache;
}
use of org.glassfish.internal.api.JavaEEContextUtil in project Payara by payara.
the class CacheManagerProxy method getCache.
@Override
public <K, V> Cache<K, V> getCache(String cacheName) {
JavaEEContextUtil ctxUtil = serverContext.getDefaultServices().getService(JavaEEContextUtil.class);
Cache<K, V> cache = delegate.getCache(cacheName);
return cache != null ? new CacheProxy<>(cache, ctxUtil) : null;
}
Aggregations