should work AFAIK, maybe update your project adding a test failling in the
case you meet and I'll try to check tonight


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-09-14 10:51 GMT-07:00 Steve Goldsmith <[email protected]>:

> OK, I'm using commons-jcs-jcache 2.0-SNAPSHOT as of today and this is the
> behavior I'm getting. What I'd like if for getCacheManager(new
>
> File("src/main/resources/jcache.ccf").toURI(),Thread.currentThread().getContextClassLoader(),
> cachingProvider.             getDefaultProperties()) to work with
> @CacheDefaults(cacheName = "testCache").
>
> Which release should I use?
>
> jcs.region.testCache=DC
>
> jcs.region.testCache.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes
> jcs.region.testCache.cacheattributes.MaxObjects=200001
>
> jcs.region.testCache.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache
> jcs.region.testCache.cacheattributes.UseMemoryShrinker=true
> jcs.region.testCache.cacheattributes.MaxMemoryIdleTimeSeconds=3600
> jcs.region.testCache.cacheattributes.ShrinkerIntervalSeconds=60
>
> jcs.region.testCache.elementattributes=org.apache.commons.jcs.engine.ElementAttributes
> jcs.region.testCache.elementattributes.IsEternal=false
> jcs.region.testCache.elementattributes.MaxLife=600
> jcs.region.testCache.elementattributes.IdleTime=1800
> jcs.region.testCache.elementattributes.IsSpool=true
> jcs.region.testCache.elementattributes.IsRemote=true
> jcs.region.testCache.elementattributes.IsLateral=true
>
> On Mon, Sep 14, 2015 at 1:20 PM, Romain Manni-Bucau <[email protected]
> >
> wrote:
>
> > Hi
> >
> > not with the snapshot normally but in last available release yes - has
> been
> > fixed in between
> >
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <http://rmannibucau.wordpress.com> | Github <
> > https://github.com/rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> > <http://www.tomitribe.com>
> >
> > 2015-09-14 10:09 GMT-07:00 sgjava <[email protected]>:
> >
> > > It looks like JCache (commons-jcs) is creating a default cache even
> > though
> > > I
> > > use:
> > >
> > > @CacheDefaults(cacheName = "testCache", cacheKeyGenerator
> > >         = StringKeyGenerator.class)
> > >
> > > Even if I use:
> > >
> > >         cacheManager = cachingProvider.getCacheManager(new File(
> > >                 "src/main/resources/jcache.ccf").toURI(),
> > >                 Thread.currentThread().getContextClassLoader(),
> > > cachingProvider.
> > >                 getDefaultProperties());
> > >         MutableConfiguration<StringGeneratedCacheKey, String> config
> > >                 = new MutableConfiguration<>();
> > >         config.setExpiryPolicyFactory(AccessedExpiryPolicy.factoryOf(
> > >                 new Duration(TimeUnit.MINUTES, 10)));
> > >         cache = cacheManager.createCache("testCache", config);
> > >
> > > In the logs I see both caches being created:
> > >
> > > Using getCacheManager:
> > >
> > > INFO: initialized MemoryCache for testCache
> > > Sep 14, 2015 1:07:58 PM
> > > org.apache.commons.jcs.engine.control.CompositeCache
> > > <init>
> > > INFO: Constructed cache with name [testCache] and cache attributes [
> > > useLateral = true, useRemote = true, useDisk = true, maxObjs = 200001,
> > > maxSpoolPerRun = -1, diskUsagePattern = SWAP, spoolChunkSize = 2 ]
> > > Sep 14, 2015 1:07:58 PM
> > > org.apache.commons.jcs.engine.control.CompositeCacheConfigurator
> > > parseAuxiliary
> > > SEVERE: Could not instantiate auxFactory named "DC".
> > > Sep 14, 2015 1:07:58 PM
> > > org.apache.commons.jcs.engine.control.CompositeCacheConfigurator
> > > parseRegions
> > > INFO: Parsed regions [testCache]
> > >
> > > Then the default version:
> > >
> > > INFO: initialized MemoryCache for testCache
> > > Sep 14, 2015 1:07:58 PM
> > > org.apache.commons.jcs.engine.control.CompositeCache
> > > <init>
> > > INFO: Constructed cache with name [testCache] and cache attributes [
> > > useLateral = true, useRemote = true, useDisk = true, maxObjs = 100,
> > > maxSpoolPerRun = -1, diskUsagePattern = SWAP, spoolChunkSize = 2 ]
> > >
> > > The annotations are using athe default configuration.
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://tomee-openejb.979440.n4.nabble.com/JCache-annotations-using-default-cache-instead-of-MutableConfiguration-or-configuration-file-tp4676198.html
> > > Sent from the TomEE Users mailing list archive at Nabble.com.
> > >
> >
>
>
>
> --
> Steven P. Goldsmith
>

Reply via email to