You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by sgjava <sg...@gmail.com> on 2015/09/04 03:52:20 UTC

commons-jcs-jcach getCacheNames not working

getCacheManager().getCacheNames() is not working with JCS. I get an empty
org.apache.commons.jcs.jcache.ImmutableIterable. The Ehcache provider
correctly returns a String iterator with the cache names. My tests run fine,
but this is a good way to check that your configuration is picked up with
multiple caches defined.



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: commons-jcs-jcach getCacheNames not working

Posted by Steve Goldsmith <sg...@gmail.com>.
You are doing explicit cache creation. I'm using jcache.ccf in
src/main/resources:

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

Sep 04, 2015 12:02:37 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 ]

It doesn't appear to pickup my configuration since I'm using
MaxObjects=200001. Is there a different place or name for the ccf?


On Fri, Sep 4, 2015 at 2:40 AM, Romain Manni-Bucau <rm...@gmail.com>
wrote:

> Hi,
>
> final CachingProvider cachingProvider = Caching.getCachingProvider();
> final CacheManager cacheManager = cachingProvider.getCacheManager();
> cacheManager.createCache("c1", new MutableConfiguration<String, String>());
> cacheManager.createCache("c2", new MutableConfiguration<String, String>());
> final Collection<String> actualNames = new ArrayList<String>(2);
> for (final String s : cacheManager.getCacheNames())
> {
>     actualNames.add(s);
> }
> assertEquals(2, actualNames.size());
> assertEquals(new HashSet<String>(asList("c1", "c2")), new
> HashSet<String>(actualNames));
> cachingProvider.close();
>
> works fine so you have a setup issue somewhere - or you dont use the
> same cache manager.
>
>
>
> 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-04 3:52 GMT+02:00 sgjava <sg...@gmail.com>:
>
> > getCacheManager().getCacheNames() is not working with JCS. I get an empty
> > org.apache.commons.jcs.jcache.ImmutableIterable. The Ehcache provider
> > correctly returns a String iterator with the cache names. My tests run
> > fine,
> > but this is a good way to check that your configuration is picked up with
> > multiple caches defined.
> >
> >
> >
> > --
> > View this message in context:
> >
> http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > Sent from the TomEE Users mailing list archive at Nabble.com.
> >
>



-- 
Steven P. Goldsmith

Re: commons-jcs-jcach getCacheNames not working

Posted by Steve Goldsmith <sg...@gmail.com>.
Build from source then?
On Sep 7, 2015 2:18 PM, "Romain Manni-Bucau" <rm...@gmail.com> wrote:

> snapshot, beta-2 is not released
>
>
> 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-07 10:11 GMT-07:00 Steve Goldsmith <sg...@gmail.com>:
>
> > Should I be using jcs-2.0-beta-2
> > <https://issues.apache.org/jira/browse/JCS/fixforversion/12328850>
> instead
> > of snapshot-2.0.0?
> >
> > On Mon, Sep 7, 2015 at 12:20 PM, Romain Manni-Bucau <
> rmannibucau@gmail.com
> > >
> > wrote:
> >
> > > think you hit the fact the built-in jcache.ccf is used cause before
> your
> > > own one in the classpath,
> https://issues.apache.org/jira/browse/JCS-152
> > > fixes it
> > >
> > >
> > > 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-07 5:45 GMT-07:00 Steve Goldsmith <sg...@gmail.com>:
> > >
> > > > OK, so now that is out of the way, is there a way to configure a
> cache
> > > with
> > > > commons-jcs configuration file? It doesn't seem to pick up my
> > jcache.ccf
> > > in
> > > > the classpath. If that works I can live without getCacheNames picking
> > it
> > > > up.
> > > >
> > > > On Sat, Sep 5, 2015 at 7:19 PM, Romain Manni-Bucau <
> > > rmannibucau@gmail.com>
> > > > wrote:
> > > >
> > > > > Le 5 sept. 2015 06:22, "Steve Goldsmith" <sg...@gmail.com> a
> écrit
> > :
> > > > > >
> > > > > > I believe the behavior of -all- providers should be the same
> from a
> > > > > JCache
> > > > > > perspective. I'm not sure why it matters how I create the cache
> if
> > > it's
> > > > > > visible to JCache API getCacheManager().getCache("testCache")
> then
> > > > > > testCache should show up via getCacheNames. It's not a game
> changer
> > > for
> > > > > me
> > > > > > right now, but what happens when someone relies on the behavior
> of
> > > > > > getCacheNames?
> > > > > >
> > > > >
> > > > > Should be but is not specified.
> > > > >
> > > > > GetCache doesnt create a cache by spec. CreateCache does.
> > > > >
> > > > > > On Fri, Sep 4, 2015 at 5:40 PM, Romain Manni-Bucau <
> > > > > rmannibucau@gmail.com>
> > > > > > wrote:
> > > > > >
> > > > > > > Then you suppose it is created if declare which is another not
> > > > defined
> > > > > > > assumption. Why wouldnt it be lazy?
> > > > > > >
> > > > > > > My point is only you cant rely on what you suppose if you want
> to
> > > > stay
> > > > > > > standard and not to say it is good or bad.
> > > > > > > Le 4 sept. 2015 23:09, "Steve Goldsmith" <sg...@gmail.com> a
> > > écrit
> > > > :
> > > > > > >
> > > > > > > > In my mind it should show up even if it's automatically
> > created.
> > > > > > > > On Sep 4, 2015 3:06 PM, "Romain Manni-Bucau" <
> > > > rmannibucau@gmail.com>
> > > > > > > > wrote:
> > > > > > > >
> > > > > > > > > We can in jcs since we have it but not sure from a API
> point
> > of
> > > > > view
> > > > > > > what
> > > > > > > > > is better - trying to not use test as an excuse ;)
> > > > > > > > > Le 4 sept. 2015 20:42, "Steve Goldsmith" <sgjava@gmail.com
> >
> > a
> > > > > écrit
> > > > > :
> > > > > > > > >
> > > > > > > > > > Yea, just nice to see the cache show up before you use it
> > in
> > > > unit
> > > > > > > tests
> > > > > > > > > :)
> > > > > > > > > > Not a biggie from a normal coding perspective.
> > > > > > > > > >
> > > > > > > > > > On Fri, Sep 4, 2015 at 2:32 PM, Romain Manni-Bucau <
> > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > wrote:
> > > > > > > > > >
> > > > > > > > > > > Not portable behavior then. But nothing in the standard
> > > about
> > > > > the
> > > > > > > > > config
> > > > > > > > > > so
> > > > > > > > > > > looks ok and if your cache is not therz size is empty
> so
> > > nthg
> > > > > > > > blocking
> > > > > > > > > > IMO.
> > > > > > > > > > > Le 4 sept. 2015 20:25, "Steve Goldsmith" <
> > sgjava@gmail.com
> > > >
> > > > a
> > > > > > > écrit
> > > > > > > > :
> > > > > > > > > > >
> > > > > > > > > > > > So, you have to explicitly do the createCache? This
> is
> > > > > different
> > > > > > > > > > behavior
> > > > > > > > > > > > then Ehcache provider. I do not want to code to a
> > > provider
> > > > if
> > > > > > > > > possible.
> > > > > > > > > > > The
> > > > > > > > > > > > weird thing is everything works except getCacheNames,
> > so
> > > > far
> > > > > :)
> > > > > > > > > > > >
> > > > > > > > > > > > On Fri, Sep 4, 2015 at 1:35 PM, Romain Manni-Bucau <
> > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > > Le 4 sept. 2015 19:30, "Steve Goldsmith" <
> > > > sgjava@gmail.com
> > > > > >
> > > > > a
> > > > > > > > > écrit
> > > > > > > > > > :
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > So if I specify jcache.ccf in classpath, then
> > > > technically
> > > > > it
> > > > > > > > > should
> > > > > > > > > > > > show
> > > > > > > > > > > > > up
> > > > > > > > > > > > > > via getCacheNames? It doesn't appear to pick it
> up
> > > from
> > > > > > > > > > > > > > src/main/resources/jcache.ccf.
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > No. If you use one of these cache through jcache
> then
> > > the
> > > > > > > config
> > > > > > > > > > should
> > > > > > > > > > > > get
> > > > > > > > > > > > > used and the cache be listed. If you start and dont
> > use
> > > > > jcache
> > > > > > > -
> > > > > > > > > even
> > > > > > > > > > > > using
> > > > > > > > > > > > > jcs internals - you ll get an empty iterable.
> > > > > > > > > > > > >
> > > > > > > > > > > > > > On Fri, Sep 4, 2015 at 1:17 PM, Romain
> Manni-Bucau
> > <
> > > > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > > Think it does but maybe it takes another one.
> > About
> > > > > > > > > getCacheNames
> > > > > > > > > > > it
> > > > > > > > > > > > is
> > > > > > > > > > > > > > > only *created* caches ie the one jcache saw and
> > not
> > > > the
> > > > > > > ones
> > > > > > > > > jcs
> > > > > > > > > > > has.
> > > > > > > > > > > > > > > Le 4 sept. 2015 19:14, "Steve Goldsmith" <
> > > > > sgjava@gmail.com
> > > > > > > >
> > > > > > > > a
> > > > > > > > > > > écrit
> > > > > > > > > > > > :
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > Looking at
> > > > > > > org.apache.commons.jcs.jcache.JCSCachingProvider
> > > > > > > > > it
> > > > > > > > > > > > > doesn't
> > > > > > > > > > > > > > > > appear to search classpath? Do you have to
> > > > explicitly
> > > > > > > > specify
> > > > > > > > > > > path
> > > > > > > > > > > > in
> > > > > > > > > > > > > > > > getCacheManager call?
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > On Fri, Sep 4, 2015 at 2:40 AM, Romain
> > > Manni-Bucau
> > > > <
> > > > > > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > Hi,
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > final CachingProvider cachingProvider =
> > > > > > > > > > > > > Caching.getCachingProvider();
> > > > > > > > > > > > > > > > > final CacheManager cacheManager =
> > > > > > > > > > > > > cachingProvider.getCacheManager();
> > > > > > > > > > > > > > > > > cacheManager.createCache("c1", new
> > > > > > > > > > MutableConfiguration<String,
> > > > > > > > > > > > > > > > String>());
> > > > > > > > > > > > > > > > > cacheManager.createCache("c2", new
> > > > > > > > > > MutableConfiguration<String,
> > > > > > > > > > > > > > > > String>());
> > > > > > > > > > > > > > > > > final Collection<String> actualNames = new
> > > > > > > > > > > ArrayList<String>(2);
> > > > > > > > > > > > > > > > > for (final String s :
> > > > cacheManager.getCacheNames())
> > > > > > > > > > > > > > > > > {
> > > > > > > > > > > > > > > > >     actualNames.add(s);
> > > > > > > > > > > > > > > > > }
> > > > > > > > > > > > > > > > > assertEquals(2, actualNames.size());
> > > > > > > > > > > > > > > > > assertEquals(new
> HashSet<String>(asList("c1",
> > > > > "c2")),
> > > > > > > new
> > > > > > > > > > > > > > > > > HashSet<String>(actualNames));
> > > > > > > > > > > > > > > > > cachingProvider.close();
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > works fine so you have a setup issue
> > somewhere
> > > -
> > > > or
> > > > > you
> > > > > > > > > dont
> > > > > > > > > > > use
> > > > > > > > > > > > > the
> > > > > > > > > > > > > > > > > same cache manager.
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > 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-04 3:52 GMT+02:00 sgjava <
> > > > sgjava@gmail.com
> > > > > >:
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > getCacheManager().getCacheNames() is not
> > > > working
> > > > > with
> > > > > > > > > JCS.
> > > > > > > > > > I
> > > > > > > > > > > > get
> > > > > > > > > > > > > an
> > > > > > > > > > > > > > > > empty
> > > > > > > > > > > > > > > > > >
> > > > org.apache.commons.jcs.jcache.ImmutableIterable.
> > > > > The
> > > > > > > > > > Ehcache
> > > > > > > > > > > > > provider
> > > > > > > > > > > > > > > > > > correctly returns a String iterator with
> > the
> > > > > cache
> > > > > > > > names.
> > > > > > > > > > My
> > > > > > > > > > > > > tests
> > > > > > > > > > > > > > > run
> > > > > > > > > > > > > > > > > > fine,
> > > > > > > > > > > > > > > > > > but this is a good way to check that your
> > > > > > > configuration
> > > > > > > > > is
> > > > > > > > > > > > picked
> > > > > > > > > > > > > up
> > > > > > > > > > > > > > > > with
> > > > > > > > > > > > > > > > > > multiple caches defined.
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > > > > View this message in context:
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > >
> > > > >
> > > >
> > >
> >
> http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > > > > > > > > > > > > > > > > > Sent from the TomEE Users mailing list
> > > archive
> > > > at
> > > > > > > > > > Nabble.com.
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > --
> > > > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > --
> > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Steven P. Goldsmith
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Steven P. Goldsmith
> > > >
> > >
> >
> >
> >
> > --
> > Steven P. Goldsmith
> >
>

Re: commons-jcs-jcach getCacheNames not working

Posted by Steve Goldsmith <sg...@gmail.com>.
OK, I'll try to pull snapshot again...

On Mon, Sep 7, 2015 at 5:21 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:

> File shouldnt be here anymore in jcs.
> Le 7 sept. 2015 14:02, "Steve Goldsmith" <sg...@gmail.com> a écrit :
>
> > I was just building my project and it's using 2.0-20150807.022522-150 :)
> It
> > looks like jcache.ccf is still there, but you removed from
> > https://issues.apache.org/jira/browse/JCS-152? I place jcache.ccf in
> > src/main/resources, but I get:
> >
> > Sep 07, 2015 4:56:52 PM
> > org.apache.commons.jcs.engine.control.CompositeCacheConfigurator
> > parseElementAttributes
> > INFO: No special ElementAttribute class defined for key
> > [jcs.region.testCache.elementattributes], using default class.
> >
> > Even though I define:
> >
> >
> >
> jcs.region.testCache.elementattributes=org.apache.commons.jcs.engine.ElementAttributes
> >
> >
> > On Mon, Sep 7, 2015 at 4:55 PM, Romain Manni-Bucau <
> rmannibucau@gmail.com>
> > wrote:
> >
> > > Shouldnt but depends on the api you use.
> > >
> > > Snapshot is redeployed btw.
> > >
> > > Le 7 sept. 2015 13:42, "Steve Goldsmith" <sg...@gmail.com> a écrit :
> > > >
> > > > It looks like your change
> > > >
> > >
> > >
> >
> https://github.com/apache/commons-jcs/commit/0970e8f84e95d8662a826f8417141e3feffb18ae
> > > > expects explicit getCacheManager(URI uri, ClassLoader classLoader,
> > > > Properties properties) versus default getCacheManager(). EHcache
> > provider
> > > > loads configuration file using the no params method. If you looked
> for
> > > > jcache.ccf in classpath then fall back to DEFAULT_CONFIG?
> > > >
> > > > On Mon, Sep 7, 2015 at 2:17 PM, Romain Manni-Bucau <
> > > rmannibucau@gmail.com>
> > > > wrote:
> > > >
> > > > > snapshot, beta-2 is not released
> > > > >
> > > > >
> > > > > 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-07 10:11 GMT-07:00 Steve Goldsmith <sg...@gmail.com>:
> > > > >
> > > > > > Should I be using jcs-2.0-beta-2
> > > > > > <
> https://issues.apache.org/jira/browse/JCS/fixforversion/12328850>
> > > > > instead
> > > > > > of snapshot-2.0.0?
> > > > > >
> > > > > > On Mon, Sep 7, 2015 at 12:20 PM, Romain Manni-Bucau <
> > > > > rmannibucau@gmail.com
> > > > > > >
> > > > > > wrote:
> > > > > >
> > > > > > > think you hit the fact the built-in jcache.ccf is used cause
> > before
> > > > > your
> > > > > > > own one in the classpath,
> > > > > https://issues.apache.org/jira/browse/JCS-152
> > > > > > > fixes it
> > > > > > >
> > > > > > >
> > > > > > > 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-07 5:45 GMT-07:00 Steve Goldsmith <sg...@gmail.com>:
> > > > > > >
> > > > > > > > OK, so now that is out of the way, is there a way to
> configure
> > a
> > > > > cache
> > > > > > > with
> > > > > > > > commons-jcs configuration file? It doesn't seem to pick up my
> > > > > > jcache.ccf
> > > > > > > in
> > > > > > > > the classpath. If that works I can live without getCacheNames
> > > picking
> > > > > > it
> > > > > > > > up.
> > > > > > > >
> > > > > > > > On Sat, Sep 5, 2015 at 7:19 PM, Romain Manni-Bucau <
> > > > > > > rmannibucau@gmail.com>
> > > > > > > > wrote:
> > > > > > > >
> > > > > > > > > Le 5 sept. 2015 06:22, "Steve Goldsmith" <sgjava@gmail.com
> >
> > a
> > > > > écrit
> > > > > > :
> > > > > > > > > >
> > > > > > > > > > I believe the behavior of -all- providers should be the
> > same
> > > > > from a
> > > > > > > > > JCache
> > > > > > > > > > perspective. I'm not sure why it matters how I create the
> > > cache
> > > > > if
> > > > > > > it's
> > > > > > > > > > visible to JCache API
> > getCacheManager().getCache("testCache")
> > > > > then
> > > > > > > > > > testCache should show up via getCacheNames. It's not a
> game
> > > > > changer
> > > > > > > for
> > > > > > > > > me
> > > > > > > > > > right now, but what happens when someone relies on the
> > > behavior
> > > > > of
> > > > > > > > > > getCacheNames?
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > > Should be but is not specified.
> > > > > > > > >
> > > > > > > > > GetCache doesnt create a cache by spec. CreateCache does.
> > > > > > > > >
> > > > > > > > > > On Fri, Sep 4, 2015 at 5:40 PM, Romain Manni-Bucau <
> > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > wrote:
> > > > > > > > > >
> > > > > > > > > > > Then you suppose it is created if declare which is
> > another
> > > not
> > > > > > > > defined
> > > > > > > > > > > assumption. Why wouldnt it be lazy?
> > > > > > > > > > >
> > > > > > > > > > > My point is only you cant rely on what you suppose if
> you
> > > want
> > > > > to
> > > > > > > > stay
> > > > > > > > > > > standard and not to say it is good or bad.
> > > > > > > > > > > Le 4 sept. 2015 23:09, "Steve Goldsmith" <
> > sgjava@gmail.com
> > > >
> > > a
> > > > > > > écrit
> > > > > > > > :
> > > > > > > > > > >
> > > > > > > > > > > > In my mind it should show up even if it's
> automatically
> > > > > > created.
> > > > > > > > > > > > On Sep 4, 2015 3:06 PM, "Romain Manni-Bucau" <
> > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > > We can in jcs since we have it but not sure from a
> > API
> > > > > point
> > > > > > of
> > > > > > > > > view
> > > > > > > > > > > what
> > > > > > > > > > > > > is better - trying to not use test as an excuse ;)
> > > > > > > > > > > > > Le 4 sept. 2015 20:42, "Steve Goldsmith" <
> > > sgjava@gmail.com
> > > > > >
> > > > > > a
> > > > > > > > > écrit
> > > > > > > > > :
> > > > > > > > > > > > >
> > > > > > > > > > > > > > Yea, just nice to see the cache show up before
> you
> > > use it
> > > > > > in
> > > > > > > > unit
> > > > > > > > > > > tests
> > > > > > > > > > > > > :)
> > > > > > > > > > > > > > Not a biggie from a normal coding perspective.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > On Fri, Sep 4, 2015 at 2:32 PM, Romain
> Manni-Bucau
> > <
> > > > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > > Not portable behavior then. But nothing in the
> > > standard
> > > > > > > about
> > > > > > > > > the
> > > > > > > > > > > > > config
> > > > > > > > > > > > > > so
> > > > > > > > > > > > > > > looks ok and if your cache is not therz size is
> > > empty
> > > > > so
> > > > > > > nthg
> > > > > > > > > > > > blocking
> > > > > > > > > > > > > > IMO.
> > > > > > > > > > > > > > > Le 4 sept. 2015 20:25, "Steve Goldsmith" <
> > > > > > sgjava@gmail.com
> > > > > > > >
> > > > > > > > a
> > > > > > > > > > > écrit
> > > > > > > > > > > > :
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > So, you have to explicitly do the
> createCache?
> > > This
> > > > > is
> > > > > > > > > different
> > > > > > > > > > > > > > behavior
> > > > > > > > > > > > > > > > then Ehcache provider. I do not want to code
> > to a
> > > > > > > provider
> > > > > > > > if
> > > > > > > > > > > > > possible.
> > > > > > > > > > > > > > > The
> > > > > > > > > > > > > > > > weird thing is everything works except
> > > getCacheNames,
> > > > > > so
> > > > > > > > far
> > > > > > > > > :)
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > On Fri, Sep 4, 2015 at 1:35 PM, Romain
> > > Manni-Bucau <
> > > > > > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > Le 4 sept. 2015 19:30, "Steve Goldsmith" <
> > > > > > > > sgjava@gmail.com
> > > > > > > > > >
> > > > > > > > > a
> > > > > > > > > > > > > écrit
> > > > > > > > > > > > > > :
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > So if I specify jcache.ccf in classpath,
> > then
> > > > > > > > technically
> > > > > > > > > it
> > > > > > > > > > > > > should
> > > > > > > > > > > > > > > > show
> > > > > > > > > > > > > > > > > up
> > > > > > > > > > > > > > > > > > via getCacheNames? It doesn't appear to
> > pick
> > > it
> > > > > up
> > > > > > > from
> > > > > > > > > > > > > > > > > > src/main/resources/jcache.ccf.
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > No. If you use one of these cache through
> > > jcache
> > > > > then
> > > > > > > the
> > > > > > > > > > > config
> > > > > > > > > > > > > > should
> > > > > > > > > > > > > > > > get
> > > > > > > > > > > > > > > > > used and the cache be listed. If you start
> > and
> > > dont
> > > > > > use
> > > > > > > > > jcache
> > > > > > > > > > > -
> > > > > > > > > > > > > even
> > > > > > > > > > > > > > > > using
> > > > > > > > > > > > > > > > > jcs internals - you ll get an empty
> iterable.
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > On Fri, Sep 4, 2015 at 1:17 PM, Romain
> > > > > Manni-Bucau
> > > > > > <
> > > > > > > > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > Think it does but maybe it takes
> another
> > > one.
> > > > > > About
> > > > > > > > > > > > > getCacheNames
> > > > > > > > > > > > > > > it
> > > > > > > > > > > > > > > > is
> > > > > > > > > > > > > > > > > > > only *created* caches ie the one jcache
> > saw
> > > and
> > > > > > not
> > > > > > > > the
> > > > > > > > > > > ones
> > > > > > > > > > > > > jcs
> > > > > > > > > > > > > > > has.
> > > > > > > > > > > > > > > > > > > Le 4 sept. 2015 19:14, "Steve
> Goldsmith"
> > <
> > > > > > > > > sgjava@gmail.com
> > > > > > > > > > > >
> > > > > > > > > > > > a
> > > > > > > > > > > > > > > écrit
> > > > > > > > > > > > > > > > :
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > Looking at
> > > > > > > > > > > org.apache.commons.jcs.jcache.JCSCachingProvider
> > > > > > > > > > > > > it
> > > > > > > > > > > > > > > > > doesn't
> > > > > > > > > > > > > > > > > > > > appear to search classpath? Do you
> have
> > > to
> > > > > > > > explicitly
> > > > > > > > > > > > specify
> > > > > > > > > > > > > > > path
> > > > > > > > > > > > > > > > in
> > > > > > > > > > > > > > > > > > > > getCacheManager call?
> > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > On Fri, Sep 4, 2015 at 2:40 AM,
> Romain
> > > > > > > Manni-Bucau
> > > > > > > > <
> > > > > > > > > > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > Hi,
> > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > final CachingProvider
> > cachingProvider =
> > > > > > > > > > > > > > > > > Caching.getCachingProvider();
> > > > > > > > > > > > > > > > > > > > > final CacheManager cacheManager =
> > > > > > > > > > > > > > > > > cachingProvider.getCacheManager();
> > > > > > > > > > > > > > > > > > > > > cacheManager.createCache("c1", new
> > > > > > > > > > > > > > MutableConfiguration<String,
> > > > > > > > > > > > > > > > > > > > String>());
> > > > > > > > > > > > > > > > > > > > > cacheManager.createCache("c2", new
> > > > > > > > > > > > > > MutableConfiguration<String,
> > > > > > > > > > > > > > > > > > > > String>());
> > > > > > > > > > > > > > > > > > > > > final Collection<String>
> actualNames
> > =
> > > new
> > > > > > > > > > > > > > > ArrayList<String>(2);
> > > > > > > > > > > > > > > > > > > > > for (final String s :
> > > > > > > > cacheManager.getCacheNames())
> > > > > > > > > > > > > > > > > > > > > {
> > > > > > > > > > > > > > > > > > > > >     actualNames.add(s);
> > > > > > > > > > > > > > > > > > > > > }
> > > > > > > > > > > > > > > > > > > > > assertEquals(2,
> actualNames.size());
> > > > > > > > > > > > > > > > > > > > > assertEquals(new
> > > > > HashSet<String>(asList("c1",
> > > > > > > > > "c2")),
> > > > > > > > > > > new
> > > > > > > > > > > > > > > > > > > > > HashSet<String>(actualNames));
> > > > > > > > > > > > > > > > > > > > > cachingProvider.close();
> > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > works fine so you have a setup
> issue
> > > > > > somewhere
> > > > > > > -
> > > > > > > > or
> > > > > > > > > you
> > > > > > > > > > > > > dont
> > > > > > > > > > > > > > > use
> > > > > > > > > > > > > > > > > the
> > > > > > > > > > > > > > > > > > > > > same cache manager.
> > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > 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-04 3:52 GMT+02:00 sgjava <
> > > > > > > > sgjava@gmail.com
> > > > > > > > > >:
> > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > > getCacheManager().getCacheNames()
> > is
> > > not
> > > > > > > > working
> > > > > > > > > with
> > > > > > > > > > > > > JCS.
> > > > > > > > > > > > > > I
> > > > > > > > > > > > > > > > get
> > > > > > > > > > > > > > > > > an
> > > > > > > > > > > > > > > > > > > > empty
> > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > org.apache.commons.jcs.jcache.ImmutableIterable.
> > > > > > > > > The
> > > > > > > > > > > > > > Ehcache
> > > > > > > > > > > > > > > > > provider
> > > > > > > > > > > > > > > > > > > > > > correctly returns a String
> iterator
> > > with
> > > > > > the
> > > > > > > > > cache
> > > > > > > > > > > > names.
> > > > > > > > > > > > > > My
> > > > > > > > > > > > > > > > > tests
> > > > > > > > > > > > > > > > > > > run
> > > > > > > > > > > > > > > > > > > > > > fine,
> > > > > > > > > > > > > > > > > > > > > > but this is a good way to check
> > that
> > > your
> > > > > > > > > > > configuration
> > > > > > > > > > > > > is
> > > > > > > > > > > > > > > > picked
> > > > > > > > > > > > > > > > > up
> > > > > > > > > > > > > > > > > > > > with
> > > > > > > > > > > > > > > > > > > > > > multiple caches defined.
> > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > > > > > > > > View this message in context:
> > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > >
> > >
> >
> http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > > > > > > > > > > > > > > > > > > > > > Sent from the TomEE Users mailing
> > > list
> > > > > > > archive
> > > > > > > > at
> > > > > > > > > > > > > > Nabble.com.
> > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > --
> > > > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > Steven P. Goldsmith
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > Steven P. Goldsmith
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Steven P. Goldsmith
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Steven P. Goldsmith
> > >
> >
> >
> >
> > --
> > Steven P. Goldsmith
> >
>



-- 
Steven P. Goldsmith

Re: commons-jcs-jcach getCacheNames not working

Posted by Romain Manni-Bucau <rm...@gmail.com>.
File shouldnt be here anymore in jcs.
Le 7 sept. 2015 14:02, "Steve Goldsmith" <sg...@gmail.com> a écrit :

> I was just building my project and it's using 2.0-20150807.022522-150 :) It
> looks like jcache.ccf is still there, but you removed from
> https://issues.apache.org/jira/browse/JCS-152? I place jcache.ccf in
> src/main/resources, but I get:
>
> Sep 07, 2015 4:56:52 PM
> org.apache.commons.jcs.engine.control.CompositeCacheConfigurator
> parseElementAttributes
> INFO: No special ElementAttribute class defined for key
> [jcs.region.testCache.elementattributes], using default class.
>
> Even though I define:
>
>
> jcs.region.testCache.elementattributes=org.apache.commons.jcs.engine.ElementAttributes
>
>
> On Mon, Sep 7, 2015 at 4:55 PM, Romain Manni-Bucau <rm...@gmail.com>
> wrote:
>
> > Shouldnt but depends on the api you use.
> >
> > Snapshot is redeployed btw.
> >
> > Le 7 sept. 2015 13:42, "Steve Goldsmith" <sg...@gmail.com> a écrit :
> > >
> > > It looks like your change
> > >
> >
> >
> https://github.com/apache/commons-jcs/commit/0970e8f84e95d8662a826f8417141e3feffb18ae
> > > expects explicit getCacheManager(URI uri, ClassLoader classLoader,
> > > Properties properties) versus default getCacheManager(). EHcache
> provider
> > > loads configuration file using the no params method. If you looked for
> > > jcache.ccf in classpath then fall back to DEFAULT_CONFIG?
> > >
> > > On Mon, Sep 7, 2015 at 2:17 PM, Romain Manni-Bucau <
> > rmannibucau@gmail.com>
> > > wrote:
> > >
> > > > snapshot, beta-2 is not released
> > > >
> > > >
> > > > 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-07 10:11 GMT-07:00 Steve Goldsmith <sg...@gmail.com>:
> > > >
> > > > > Should I be using jcs-2.0-beta-2
> > > > > <https://issues.apache.org/jira/browse/JCS/fixforversion/12328850>
> > > > instead
> > > > > of snapshot-2.0.0?
> > > > >
> > > > > On Mon, Sep 7, 2015 at 12:20 PM, Romain Manni-Bucau <
> > > > rmannibucau@gmail.com
> > > > > >
> > > > > wrote:
> > > > >
> > > > > > think you hit the fact the built-in jcache.ccf is used cause
> before
> > > > your
> > > > > > own one in the classpath,
> > > > https://issues.apache.org/jira/browse/JCS-152
> > > > > > fixes it
> > > > > >
> > > > > >
> > > > > > 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-07 5:45 GMT-07:00 Steve Goldsmith <sg...@gmail.com>:
> > > > > >
> > > > > > > OK, so now that is out of the way, is there a way to configure
> a
> > > > cache
> > > > > > with
> > > > > > > commons-jcs configuration file? It doesn't seem to pick up my
> > > > > jcache.ccf
> > > > > > in
> > > > > > > the classpath. If that works I can live without getCacheNames
> > picking
> > > > > it
> > > > > > > up.
> > > > > > >
> > > > > > > On Sat, Sep 5, 2015 at 7:19 PM, Romain Manni-Bucau <
> > > > > > rmannibucau@gmail.com>
> > > > > > > wrote:
> > > > > > >
> > > > > > > > Le 5 sept. 2015 06:22, "Steve Goldsmith" <sg...@gmail.com>
> a
> > > > écrit
> > > > > :
> > > > > > > > >
> > > > > > > > > I believe the behavior of -all- providers should be the
> same
> > > > from a
> > > > > > > > JCache
> > > > > > > > > perspective. I'm not sure why it matters how I create the
> > cache
> > > > if
> > > > > > it's
> > > > > > > > > visible to JCache API
> getCacheManager().getCache("testCache")
> > > > then
> > > > > > > > > testCache should show up via getCacheNames. It's not a game
> > > > changer
> > > > > > for
> > > > > > > > me
> > > > > > > > > right now, but what happens when someone relies on the
> > behavior
> > > > of
> > > > > > > > > getCacheNames?
> > > > > > > > >
> > > > > > > >
> > > > > > > > Should be but is not specified.
> > > > > > > >
> > > > > > > > GetCache doesnt create a cache by spec. CreateCache does.
> > > > > > > >
> > > > > > > > > On Fri, Sep 4, 2015 at 5:40 PM, Romain Manni-Bucau <
> > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > Then you suppose it is created if declare which is
> another
> > not
> > > > > > > defined
> > > > > > > > > > assumption. Why wouldnt it be lazy?
> > > > > > > > > >
> > > > > > > > > > My point is only you cant rely on what you suppose if you
> > want
> > > > to
> > > > > > > stay
> > > > > > > > > > standard and not to say it is good or bad.
> > > > > > > > > > Le 4 sept. 2015 23:09, "Steve Goldsmith" <
> sgjava@gmail.com
> > >
> > a
> > > > > > écrit
> > > > > > > :
> > > > > > > > > >
> > > > > > > > > > > In my mind it should show up even if it's automatically
> > > > > created.
> > > > > > > > > > > On Sep 4, 2015 3:06 PM, "Romain Manni-Bucau" <
> > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > wrote:
> > > > > > > > > > >
> > > > > > > > > > > > We can in jcs since we have it but not sure from a
> API
> > > > point
> > > > > of
> > > > > > > > view
> > > > > > > > > > what
> > > > > > > > > > > > is better - trying to not use test as an excuse ;)
> > > > > > > > > > > > Le 4 sept. 2015 20:42, "Steve Goldsmith" <
> > sgjava@gmail.com
> > > > >
> > > > > a
> > > > > > > > écrit
> > > > > > > > :
> > > > > > > > > > > >
> > > > > > > > > > > > > Yea, just nice to see the cache show up before you
> > use it
> > > > > in
> > > > > > > unit
> > > > > > > > > > tests
> > > > > > > > > > > > :)
> > > > > > > > > > > > > Not a biggie from a normal coding perspective.
> > > > > > > > > > > > >
> > > > > > > > > > > > > On Fri, Sep 4, 2015 at 2:32 PM, Romain Manni-Bucau
> <
> > > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > > wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > > > Not portable behavior then. But nothing in the
> > standard
> > > > > > about
> > > > > > > > the
> > > > > > > > > > > > config
> > > > > > > > > > > > > so
> > > > > > > > > > > > > > looks ok and if your cache is not therz size is
> > empty
> > > > so
> > > > > > nthg
> > > > > > > > > > > blocking
> > > > > > > > > > > > > IMO.
> > > > > > > > > > > > > > Le 4 sept. 2015 20:25, "Steve Goldsmith" <
> > > > > sgjava@gmail.com
> > > > > > >
> > > > > > > a
> > > > > > > > > > écrit
> > > > > > > > > > > :
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > > So, you have to explicitly do the createCache?
> > This
> > > > is
> > > > > > > > different
> > > > > > > > > > > > > behavior
> > > > > > > > > > > > > > > then Ehcache provider. I do not want to code
> to a
> > > > > > provider
> > > > > > > if
> > > > > > > > > > > > possible.
> > > > > > > > > > > > > > The
> > > > > > > > > > > > > > > weird thing is everything works except
> > getCacheNames,
> > > > > so
> > > > > > > far
> > > > > > > > :)
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > On Fri, Sep 4, 2015 at 1:35 PM, Romain
> > Manni-Bucau <
> > > > > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > Le 4 sept. 2015 19:30, "Steve Goldsmith" <
> > > > > > > sgjava@gmail.com
> > > > > > > > >
> > > > > > > > a
> > > > > > > > > > > > écrit
> > > > > > > > > > > > > :
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > So if I specify jcache.ccf in classpath,
> then
> > > > > > > technically
> > > > > > > > it
> > > > > > > > > > > > should
> > > > > > > > > > > > > > > show
> > > > > > > > > > > > > > > > up
> > > > > > > > > > > > > > > > > via getCacheNames? It doesn't appear to
> pick
> > it
> > > > up
> > > > > > from
> > > > > > > > > > > > > > > > > src/main/resources/jcache.ccf.
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > No. If you use one of these cache through
> > jcache
> > > > then
> > > > > > the
> > > > > > > > > > config
> > > > > > > > > > > > > should
> > > > > > > > > > > > > > > get
> > > > > > > > > > > > > > > > used and the cache be listed. If you start
> and
> > dont
> > > > > use
> > > > > > > > jcache
> > > > > > > > > > -
> > > > > > > > > > > > even
> > > > > > > > > > > > > > > using
> > > > > > > > > > > > > > > > jcs internals - you ll get an empty iterable.
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > On Fri, Sep 4, 2015 at 1:17 PM, Romain
> > > > Manni-Bucau
> > > > > <
> > > > > > > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > Think it does but maybe it takes another
> > one.
> > > > > About
> > > > > > > > > > > > getCacheNames
> > > > > > > > > > > > > > it
> > > > > > > > > > > > > > > is
> > > > > > > > > > > > > > > > > > only *created* caches ie the one jcache
> saw
> > and
> > > > > not
> > > > > > > the
> > > > > > > > > > ones
> > > > > > > > > > > > jcs
> > > > > > > > > > > > > > has.
> > > > > > > > > > > > > > > > > > Le 4 sept. 2015 19:14, "Steve Goldsmith"
> <
> > > > > > > > sgjava@gmail.com
> > > > > > > > > > >
> > > > > > > > > > > a
> > > > > > > > > > > > > > écrit
> > > > > > > > > > > > > > > :
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > Looking at
> > > > > > > > > > org.apache.commons.jcs.jcache.JCSCachingProvider
> > > > > > > > > > > > it
> > > > > > > > > > > > > > > > doesn't
> > > > > > > > > > > > > > > > > > > appear to search classpath? Do you have
> > to
> > > > > > > explicitly
> > > > > > > > > > > specify
> > > > > > > > > > > > > > path
> > > > > > > > > > > > > > > in
> > > > > > > > > > > > > > > > > > > getCacheManager call?
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > On Fri, Sep 4, 2015 at 2:40 AM, Romain
> > > > > > Manni-Bucau
> > > > > > > <
> > > > > > > > > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > Hi,
> > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > final CachingProvider
> cachingProvider =
> > > > > > > > > > > > > > > > Caching.getCachingProvider();
> > > > > > > > > > > > > > > > > > > > final CacheManager cacheManager =
> > > > > > > > > > > > > > > > cachingProvider.getCacheManager();
> > > > > > > > > > > > > > > > > > > > cacheManager.createCache("c1", new
> > > > > > > > > > > > > MutableConfiguration<String,
> > > > > > > > > > > > > > > > > > > String>());
> > > > > > > > > > > > > > > > > > > > cacheManager.createCache("c2", new
> > > > > > > > > > > > > MutableConfiguration<String,
> > > > > > > > > > > > > > > > > > > String>());
> > > > > > > > > > > > > > > > > > > > final Collection<String> actualNames
> =
> > new
> > > > > > > > > > > > > > ArrayList<String>(2);
> > > > > > > > > > > > > > > > > > > > for (final String s :
> > > > > > > cacheManager.getCacheNames())
> > > > > > > > > > > > > > > > > > > > {
> > > > > > > > > > > > > > > > > > > >     actualNames.add(s);
> > > > > > > > > > > > > > > > > > > > }
> > > > > > > > > > > > > > > > > > > > assertEquals(2, actualNames.size());
> > > > > > > > > > > > > > > > > > > > assertEquals(new
> > > > HashSet<String>(asList("c1",
> > > > > > > > "c2")),
> > > > > > > > > > new
> > > > > > > > > > > > > > > > > > > > HashSet<String>(actualNames));
> > > > > > > > > > > > > > > > > > > > cachingProvider.close();
> > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > works fine so you have a setup issue
> > > > > somewhere
> > > > > > -
> > > > > > > or
> > > > > > > > you
> > > > > > > > > > > > dont
> > > > > > > > > > > > > > use
> > > > > > > > > > > > > > > > the
> > > > > > > > > > > > > > > > > > > > same cache manager.
> > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > 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-04 3:52 GMT+02:00 sgjava <
> > > > > > > sgjava@gmail.com
> > > > > > > > >:
> > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > getCacheManager().getCacheNames()
> is
> > not
> > > > > > > working
> > > > > > > > with
> > > > > > > > > > > > JCS.
> > > > > > > > > > > > > I
> > > > > > > > > > > > > > > get
> > > > > > > > > > > > > > > > an
> > > > > > > > > > > > > > > > > > > empty
> > > > > > > > > > > > > > > > > > > > >
> > > > > > > org.apache.commons.jcs.jcache.ImmutableIterable.
> > > > > > > > The
> > > > > > > > > > > > > Ehcache
> > > > > > > > > > > > > > > > provider
> > > > > > > > > > > > > > > > > > > > > correctly returns a String iterator
> > with
> > > > > the
> > > > > > > > cache
> > > > > > > > > > > names.
> > > > > > > > > > > > > My
> > > > > > > > > > > > > > > > tests
> > > > > > > > > > > > > > > > > > run
> > > > > > > > > > > > > > > > > > > > > fine,
> > > > > > > > > > > > > > > > > > > > > but this is a good way to check
> that
> > your
> > > > > > > > > > configuration
> > > > > > > > > > > > is
> > > > > > > > > > > > > > > picked
> > > > > > > > > > > > > > > > up
> > > > > > > > > > > > > > > > > > > with
> > > > > > > > > > > > > > > > > > > > > multiple caches defined.
> > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > > > > > > > View this message in context:
> > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> >
> >
> http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > > > > > > > > > > > > > > > > > > > > Sent from the TomEE Users mailing
> > list
> > > > > > archive
> > > > > > > at
> > > > > > > > > > > > > Nabble.com.
> > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > --
> > > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > Steven P. Goldsmith
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Steven P. Goldsmith
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Steven P. Goldsmith
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Steven P. Goldsmith
> >
>
>
>
> --
> Steven P. Goldsmith
>

Re: commons-jcs-jcach getCacheNames not working

Posted by Steve Goldsmith <sg...@gmail.com>.
I was just building my project and it's using 2.0-20150807.022522-150 :) It
looks like jcache.ccf is still there, but you removed from
https://issues.apache.org/jira/browse/JCS-152? I place jcache.ccf in
src/main/resources, but I get:

Sep 07, 2015 4:56:52 PM
org.apache.commons.jcs.engine.control.CompositeCacheConfigurator
parseElementAttributes
INFO: No special ElementAttribute class defined for key
[jcs.region.testCache.elementattributes], using default class.

Even though I define:

jcs.region.testCache.elementattributes=org.apache.commons.jcs.engine.ElementAttributes


On Mon, Sep 7, 2015 at 4:55 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:

> Shouldnt but depends on the api you use.
>
> Snapshot is redeployed btw.
>
> Le 7 sept. 2015 13:42, "Steve Goldsmith" <sg...@gmail.com> a écrit :
> >
> > It looks like your change
> >
>
> https://github.com/apache/commons-jcs/commit/0970e8f84e95d8662a826f8417141e3feffb18ae
> > expects explicit getCacheManager(URI uri, ClassLoader classLoader,
> > Properties properties) versus default getCacheManager(). EHcache provider
> > loads configuration file using the no params method. If you looked for
> > jcache.ccf in classpath then fall back to DEFAULT_CONFIG?
> >
> > On Mon, Sep 7, 2015 at 2:17 PM, Romain Manni-Bucau <
> rmannibucau@gmail.com>
> > wrote:
> >
> > > snapshot, beta-2 is not released
> > >
> > >
> > > 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-07 10:11 GMT-07:00 Steve Goldsmith <sg...@gmail.com>:
> > >
> > > > Should I be using jcs-2.0-beta-2
> > > > <https://issues.apache.org/jira/browse/JCS/fixforversion/12328850>
> > > instead
> > > > of snapshot-2.0.0?
> > > >
> > > > On Mon, Sep 7, 2015 at 12:20 PM, Romain Manni-Bucau <
> > > rmannibucau@gmail.com
> > > > >
> > > > wrote:
> > > >
> > > > > think you hit the fact the built-in jcache.ccf is used cause before
> > > your
> > > > > own one in the classpath,
> > > https://issues.apache.org/jira/browse/JCS-152
> > > > > fixes it
> > > > >
> > > > >
> > > > > 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-07 5:45 GMT-07:00 Steve Goldsmith <sg...@gmail.com>:
> > > > >
> > > > > > OK, so now that is out of the way, is there a way to configure a
> > > cache
> > > > > with
> > > > > > commons-jcs configuration file? It doesn't seem to pick up my
> > > > jcache.ccf
> > > > > in
> > > > > > the classpath. If that works I can live without getCacheNames
> picking
> > > > it
> > > > > > up.
> > > > > >
> > > > > > On Sat, Sep 5, 2015 at 7:19 PM, Romain Manni-Bucau <
> > > > > rmannibucau@gmail.com>
> > > > > > wrote:
> > > > > >
> > > > > > > Le 5 sept. 2015 06:22, "Steve Goldsmith" <sg...@gmail.com> a
> > > écrit
> > > > :
> > > > > > > >
> > > > > > > > I believe the behavior of -all- providers should be the same
> > > from a
> > > > > > > JCache
> > > > > > > > perspective. I'm not sure why it matters how I create the
> cache
> > > if
> > > > > it's
> > > > > > > > visible to JCache API getCacheManager().getCache("testCache")
> > > then
> > > > > > > > testCache should show up via getCacheNames. It's not a game
> > > changer
> > > > > for
> > > > > > > me
> > > > > > > > right now, but what happens when someone relies on the
> behavior
> > > of
> > > > > > > > getCacheNames?
> > > > > > > >
> > > > > > >
> > > > > > > Should be but is not specified.
> > > > > > >
> > > > > > > GetCache doesnt create a cache by spec. CreateCache does.
> > > > > > >
> > > > > > > > On Fri, Sep 4, 2015 at 5:40 PM, Romain Manni-Bucau <
> > > > > > > rmannibucau@gmail.com>
> > > > > > > > wrote:
> > > > > > > >
> > > > > > > > > Then you suppose it is created if declare which is another
> not
> > > > > > defined
> > > > > > > > > assumption. Why wouldnt it be lazy?
> > > > > > > > >
> > > > > > > > > My point is only you cant rely on what you suppose if you
> want
> > > to
> > > > > > stay
> > > > > > > > > standard and not to say it is good or bad.
> > > > > > > > > Le 4 sept. 2015 23:09, "Steve Goldsmith" <sgjava@gmail.com
> >
> a
> > > > > écrit
> > > > > > :
> > > > > > > > >
> > > > > > > > > > In my mind it should show up even if it's automatically
> > > > created.
> > > > > > > > > > On Sep 4, 2015 3:06 PM, "Romain Manni-Bucau" <
> > > > > > rmannibucau@gmail.com>
> > > > > > > > > > wrote:
> > > > > > > > > >
> > > > > > > > > > > We can in jcs since we have it but not sure from a API
> > > point
> > > > of
> > > > > > > view
> > > > > > > > > what
> > > > > > > > > > > is better - trying to not use test as an excuse ;)
> > > > > > > > > > > Le 4 sept. 2015 20:42, "Steve Goldsmith" <
> sgjava@gmail.com
> > > >
> > > > a
> > > > > > > écrit
> > > > > > > :
> > > > > > > > > > >
> > > > > > > > > > > > Yea, just nice to see the cache show up before you
> use it
> > > > in
> > > > > > unit
> > > > > > > > > tests
> > > > > > > > > > > :)
> > > > > > > > > > > > Not a biggie from a normal coding perspective.
> > > > > > > > > > > >
> > > > > > > > > > > > On Fri, Sep 4, 2015 at 2:32 PM, Romain Manni-Bucau <
> > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > > Not portable behavior then. But nothing in the
> standard
> > > > > about
> > > > > > > the
> > > > > > > > > > > config
> > > > > > > > > > > > so
> > > > > > > > > > > > > looks ok and if your cache is not therz size is
> empty
> > > so
> > > > > nthg
> > > > > > > > > > blocking
> > > > > > > > > > > > IMO.
> > > > > > > > > > > > > Le 4 sept. 2015 20:25, "Steve Goldsmith" <
> > > > sgjava@gmail.com
> > > > > >
> > > > > > a
> > > > > > > > > écrit
> > > > > > > > > > :
> > > > > > > > > > > > >
> > > > > > > > > > > > > > So, you have to explicitly do the createCache?
> This
> > > is
> > > > > > > different
> > > > > > > > > > > > behavior
> > > > > > > > > > > > > > then Ehcache provider. I do not want to code to a
> > > > > provider
> > > > > > if
> > > > > > > > > > > possible.
> > > > > > > > > > > > > The
> > > > > > > > > > > > > > weird thing is everything works except
> getCacheNames,
> > > > so
> > > > > > far
> > > > > > > :)
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > On Fri, Sep 4, 2015 at 1:35 PM, Romain
> Manni-Bucau <
> > > > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > > Le 4 sept. 2015 19:30, "Steve Goldsmith" <
> > > > > > sgjava@gmail.com
> > > > > > > >
> > > > > > > a
> > > > > > > > > > > écrit
> > > > > > > > > > > > :
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > So if I specify jcache.ccf in classpath, then
> > > > > > technically
> > > > > > > it
> > > > > > > > > > > should
> > > > > > > > > > > > > > show
> > > > > > > > > > > > > > > up
> > > > > > > > > > > > > > > > via getCacheNames? It doesn't appear to pick
> it
> > > up
> > > > > from
> > > > > > > > > > > > > > > > src/main/resources/jcache.ccf.
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > No. If you use one of these cache through
> jcache
> > > then
> > > > > the
> > > > > > > > > config
> > > > > > > > > > > > should
> > > > > > > > > > > > > > get
> > > > > > > > > > > > > > > used and the cache be listed. If you start and
> dont
> > > > use
> > > > > > > jcache
> > > > > > > > > -
> > > > > > > > > > > even
> > > > > > > > > > > > > > using
> > > > > > > > > > > > > > > jcs internals - you ll get an empty iterable.
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > On Fri, Sep 4, 2015 at 1:17 PM, Romain
> > > Manni-Bucau
> > > > <
> > > > > > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > Think it does but maybe it takes another
> one.
> > > > About
> > > > > > > > > > > getCacheNames
> > > > > > > > > > > > > it
> > > > > > > > > > > > > > is
> > > > > > > > > > > > > > > > > only *created* caches ie the one jcache saw
> and
> > > > not
> > > > > > the
> > > > > > > > > ones
> > > > > > > > > > > jcs
> > > > > > > > > > > > > has.
> > > > > > > > > > > > > > > > > Le 4 sept. 2015 19:14, "Steve Goldsmith" <
> > > > > > > sgjava@gmail.com
> > > > > > > > > >
> > > > > > > > > > a
> > > > > > > > > > > > > écrit
> > > > > > > > > > > > > > :
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > Looking at
> > > > > > > > > org.apache.commons.jcs.jcache.JCSCachingProvider
> > > > > > > > > > > it
> > > > > > > > > > > > > > > doesn't
> > > > > > > > > > > > > > > > > > appear to search classpath? Do you have
> to
> > > > > > explicitly
> > > > > > > > > > specify
> > > > > > > > > > > > > path
> > > > > > > > > > > > > > in
> > > > > > > > > > > > > > > > > > getCacheManager call?
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > On Fri, Sep 4, 2015 at 2:40 AM, Romain
> > > > > Manni-Bucau
> > > > > > <
> > > > > > > > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > Hi,
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > final CachingProvider cachingProvider =
> > > > > > > > > > > > > > > Caching.getCachingProvider();
> > > > > > > > > > > > > > > > > > > final CacheManager cacheManager =
> > > > > > > > > > > > > > > cachingProvider.getCacheManager();
> > > > > > > > > > > > > > > > > > > cacheManager.createCache("c1", new
> > > > > > > > > > > > MutableConfiguration<String,
> > > > > > > > > > > > > > > > > > String>());
> > > > > > > > > > > > > > > > > > > cacheManager.createCache("c2", new
> > > > > > > > > > > > MutableConfiguration<String,
> > > > > > > > > > > > > > > > > > String>());
> > > > > > > > > > > > > > > > > > > final Collection<String> actualNames =
> new
> > > > > > > > > > > > > ArrayList<String>(2);
> > > > > > > > > > > > > > > > > > > for (final String s :
> > > > > > cacheManager.getCacheNames())
> > > > > > > > > > > > > > > > > > > {
> > > > > > > > > > > > > > > > > > >     actualNames.add(s);
> > > > > > > > > > > > > > > > > > > }
> > > > > > > > > > > > > > > > > > > assertEquals(2, actualNames.size());
> > > > > > > > > > > > > > > > > > > assertEquals(new
> > > HashSet<String>(asList("c1",
> > > > > > > "c2")),
> > > > > > > > > new
> > > > > > > > > > > > > > > > > > > HashSet<String>(actualNames));
> > > > > > > > > > > > > > > > > > > cachingProvider.close();
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > works fine so you have a setup issue
> > > > somewhere
> > > > > -
> > > > > > or
> > > > > > > you
> > > > > > > > > > > dont
> > > > > > > > > > > > > use
> > > > > > > > > > > > > > > the
> > > > > > > > > > > > > > > > > > > same cache manager.
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > 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-04 3:52 GMT+02:00 sgjava <
> > > > > > sgjava@gmail.com
> > > > > > > >:
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > getCacheManager().getCacheNames() is
> not
> > > > > > working
> > > > > > > with
> > > > > > > > > > > JCS.
> > > > > > > > > > > > I
> > > > > > > > > > > > > > get
> > > > > > > > > > > > > > > an
> > > > > > > > > > > > > > > > > > empty
> > > > > > > > > > > > > > > > > > > >
> > > > > > org.apache.commons.jcs.jcache.ImmutableIterable.
> > > > > > > The
> > > > > > > > > > > > Ehcache
> > > > > > > > > > > > > > > provider
> > > > > > > > > > > > > > > > > > > > correctly returns a String iterator
> with
> > > > the
> > > > > > > cache
> > > > > > > > > > names.
> > > > > > > > > > > > My
> > > > > > > > > > > > > > > tests
> > > > > > > > > > > > > > > > > run
> > > > > > > > > > > > > > > > > > > > fine,
> > > > > > > > > > > > > > > > > > > > but this is a good way to check that
> your
> > > > > > > > > configuration
> > > > > > > > > > > is
> > > > > > > > > > > > > > picked
> > > > > > > > > > > > > > > up
> > > > > > > > > > > > > > > > > > with
> > > > > > > > > > > > > > > > > > > > multiple caches defined.
> > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > > > > > > View this message in context:
> > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
>
> http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > > > > > > > > > > > > > > > > > > > Sent from the TomEE Users mailing
> list
> > > > > archive
> > > > > > at
> > > > > > > > > > > > Nabble.com.
> > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > --
> > > > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > --
> > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > Steven P. Goldsmith
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Steven P. Goldsmith
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Steven P. Goldsmith
> > > >
> > >
> >
> >
> >
> > --
> > Steven P. Goldsmith
>



-- 
Steven P. Goldsmith

Re: commons-jcs-jcach getCacheNames not working

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Shouldnt but depends on the api you use.

Snapshot is redeployed btw.

Le 7 sept. 2015 13:42, "Steve Goldsmith" <sg...@gmail.com> a écrit :
>
> It looks like your change
>
https://github.com/apache/commons-jcs/commit/0970e8f84e95d8662a826f8417141e3feffb18ae
> expects explicit getCacheManager(URI uri, ClassLoader classLoader,
> Properties properties) versus default getCacheManager(). EHcache provider
> loads configuration file using the no params method. If you looked for
> jcache.ccf in classpath then fall back to DEFAULT_CONFIG?
>
> On Mon, Sep 7, 2015 at 2:17 PM, Romain Manni-Bucau <rm...@gmail.com>
> wrote:
>
> > snapshot, beta-2 is not released
> >
> >
> > 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-07 10:11 GMT-07:00 Steve Goldsmith <sg...@gmail.com>:
> >
> > > Should I be using jcs-2.0-beta-2
> > > <https://issues.apache.org/jira/browse/JCS/fixforversion/12328850>
> > instead
> > > of snapshot-2.0.0?
> > >
> > > On Mon, Sep 7, 2015 at 12:20 PM, Romain Manni-Bucau <
> > rmannibucau@gmail.com
> > > >
> > > wrote:
> > >
> > > > think you hit the fact the built-in jcache.ccf is used cause before
> > your
> > > > own one in the classpath,
> > https://issues.apache.org/jira/browse/JCS-152
> > > > fixes it
> > > >
> > > >
> > > > 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-07 5:45 GMT-07:00 Steve Goldsmith <sg...@gmail.com>:
> > > >
> > > > > OK, so now that is out of the way, is there a way to configure a
> > cache
> > > > with
> > > > > commons-jcs configuration file? It doesn't seem to pick up my
> > > jcache.ccf
> > > > in
> > > > > the classpath. If that works I can live without getCacheNames
picking
> > > it
> > > > > up.
> > > > >
> > > > > On Sat, Sep 5, 2015 at 7:19 PM, Romain Manni-Bucau <
> > > > rmannibucau@gmail.com>
> > > > > wrote:
> > > > >
> > > > > > Le 5 sept. 2015 06:22, "Steve Goldsmith" <sg...@gmail.com> a
> > écrit
> > > :
> > > > > > >
> > > > > > > I believe the behavior of -all- providers should be the same
> > from a
> > > > > > JCache
> > > > > > > perspective. I'm not sure why it matters how I create the
cache
> > if
> > > > it's
> > > > > > > visible to JCache API getCacheManager().getCache("testCache")
> > then
> > > > > > > testCache should show up via getCacheNames. It's not a game
> > changer
> > > > for
> > > > > > me
> > > > > > > right now, but what happens when someone relies on the
behavior
> > of
> > > > > > > getCacheNames?
> > > > > > >
> > > > > >
> > > > > > Should be but is not specified.
> > > > > >
> > > > > > GetCache doesnt create a cache by spec. CreateCache does.
> > > > > >
> > > > > > > On Fri, Sep 4, 2015 at 5:40 PM, Romain Manni-Bucau <
> > > > > > rmannibucau@gmail.com>
> > > > > > > wrote:
> > > > > > >
> > > > > > > > Then you suppose it is created if declare which is another
not
> > > > > defined
> > > > > > > > assumption. Why wouldnt it be lazy?
> > > > > > > >
> > > > > > > > My point is only you cant rely on what you suppose if you
want
> > to
> > > > > stay
> > > > > > > > standard and not to say it is good or bad.
> > > > > > > > Le 4 sept. 2015 23:09, "Steve Goldsmith" <sg...@gmail.com>
a
> > > > écrit
> > > > > :
> > > > > > > >
> > > > > > > > > In my mind it should show up even if it's automatically
> > > created.
> > > > > > > > > On Sep 4, 2015 3:06 PM, "Romain Manni-Bucau" <
> > > > > rmannibucau@gmail.com>
> > > > > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > We can in jcs since we have it but not sure from a API
> > point
> > > of
> > > > > > view
> > > > > > > > what
> > > > > > > > > > is better - trying to not use test as an excuse ;)
> > > > > > > > > > Le 4 sept. 2015 20:42, "Steve Goldsmith" <
sgjava@gmail.com
> > >
> > > a
> > > > > > écrit
> > > > > > :
> > > > > > > > > >
> > > > > > > > > > > Yea, just nice to see the cache show up before you
use it
> > > in
> > > > > unit
> > > > > > > > tests
> > > > > > > > > > :)
> > > > > > > > > > > Not a biggie from a normal coding perspective.
> > > > > > > > > > >
> > > > > > > > > > > On Fri, Sep 4, 2015 at 2:32 PM, Romain Manni-Bucau <
> > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > wrote:
> > > > > > > > > > >
> > > > > > > > > > > > Not portable behavior then. But nothing in the
standard
> > > > about
> > > > > > the
> > > > > > > > > > config
> > > > > > > > > > > so
> > > > > > > > > > > > looks ok and if your cache is not therz size is
empty
> > so
> > > > nthg
> > > > > > > > > blocking
> > > > > > > > > > > IMO.
> > > > > > > > > > > > Le 4 sept. 2015 20:25, "Steve Goldsmith" <
> > > sgjava@gmail.com
> > > > >
> > > > > a
> > > > > > > > écrit
> > > > > > > > > :
> > > > > > > > > > > >
> > > > > > > > > > > > > So, you have to explicitly do the createCache?
This
> > is
> > > > > > different
> > > > > > > > > > > behavior
> > > > > > > > > > > > > then Ehcache provider. I do not want to code to a
> > > > provider
> > > > > if
> > > > > > > > > > possible.
> > > > > > > > > > > > The
> > > > > > > > > > > > > weird thing is everything works except
getCacheNames,
> > > so
> > > > > far
> > > > > > :)
> > > > > > > > > > > > >
> > > > > > > > > > > > > On Fri, Sep 4, 2015 at 1:35 PM, Romain
Manni-Bucau <
> > > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > > wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > > > Le 4 sept. 2015 19:30, "Steve Goldsmith" <
> > > > > sgjava@gmail.com
> > > > > > >
> > > > > > a
> > > > > > > > > > écrit
> > > > > > > > > > > :
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > So if I specify jcache.ccf in classpath, then
> > > > > technically
> > > > > > it
> > > > > > > > > > should
> > > > > > > > > > > > > show
> > > > > > > > > > > > > > up
> > > > > > > > > > > > > > > via getCacheNames? It doesn't appear to pick
it
> > up
> > > > from
> > > > > > > > > > > > > > > src/main/resources/jcache.ccf.
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > No. If you use one of these cache through jcache
> > then
> > > > the
> > > > > > > > config
> > > > > > > > > > > should
> > > > > > > > > > > > > get
> > > > > > > > > > > > > > used and the cache be listed. If you start and
dont
> > > use
> > > > > > jcache
> > > > > > > > -
> > > > > > > > > > even
> > > > > > > > > > > > > using
> > > > > > > > > > > > > > jcs internals - you ll get an empty iterable.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > > On Fri, Sep 4, 2015 at 1:17 PM, Romain
> > Manni-Bucau
> > > <
> > > > > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > Think it does but maybe it takes another
one.
> > > About
> > > > > > > > > > getCacheNames
> > > > > > > > > > > > it
> > > > > > > > > > > > > is
> > > > > > > > > > > > > > > > only *created* caches ie the one jcache saw
and
> > > not
> > > > > the
> > > > > > > > ones
> > > > > > > > > > jcs
> > > > > > > > > > > > has.
> > > > > > > > > > > > > > > > Le 4 sept. 2015 19:14, "Steve Goldsmith" <
> > > > > > sgjava@gmail.com
> > > > > > > > >
> > > > > > > > > a
> > > > > > > > > > > > écrit
> > > > > > > > > > > > > :
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > Looking at
> > > > > > > > org.apache.commons.jcs.jcache.JCSCachingProvider
> > > > > > > > > > it
> > > > > > > > > > > > > > doesn't
> > > > > > > > > > > > > > > > > appear to search classpath? Do you have to
> > > > > explicitly
> > > > > > > > > specify
> > > > > > > > > > > > path
> > > > > > > > > > > > > in
> > > > > > > > > > > > > > > > > getCacheManager call?
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > On Fri, Sep 4, 2015 at 2:40 AM, Romain
> > > > Manni-Bucau
> > > > > <
> > > > > > > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > Hi,
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > final CachingProvider cachingProvider =
> > > > > > > > > > > > > > Caching.getCachingProvider();
> > > > > > > > > > > > > > > > > > final CacheManager cacheManager =
> > > > > > > > > > > > > > cachingProvider.getCacheManager();
> > > > > > > > > > > > > > > > > > cacheManager.createCache("c1", new
> > > > > > > > > > > MutableConfiguration<String,
> > > > > > > > > > > > > > > > > String>());
> > > > > > > > > > > > > > > > > > cacheManager.createCache("c2", new
> > > > > > > > > > > MutableConfiguration<String,
> > > > > > > > > > > > > > > > > String>());
> > > > > > > > > > > > > > > > > > final Collection<String> actualNames =
new
> > > > > > > > > > > > ArrayList<String>(2);
> > > > > > > > > > > > > > > > > > for (final String s :
> > > > > cacheManager.getCacheNames())
> > > > > > > > > > > > > > > > > > {
> > > > > > > > > > > > > > > > > >     actualNames.add(s);
> > > > > > > > > > > > > > > > > > }
> > > > > > > > > > > > > > > > > > assertEquals(2, actualNames.size());
> > > > > > > > > > > > > > > > > > assertEquals(new
> > HashSet<String>(asList("c1",
> > > > > > "c2")),
> > > > > > > > new
> > > > > > > > > > > > > > > > > > HashSet<String>(actualNames));
> > > > > > > > > > > > > > > > > > cachingProvider.close();
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > works fine so you have a setup issue
> > > somewhere
> > > > -
> > > > > or
> > > > > > you
> > > > > > > > > > dont
> > > > > > > > > > > > use
> > > > > > > > > > > > > > the
> > > > > > > > > > > > > > > > > > same cache manager.
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > 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-04 3:52 GMT+02:00 sgjava <
> > > > > sgjava@gmail.com
> > > > > > >:
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > getCacheManager().getCacheNames() is
not
> > > > > working
> > > > > > with
> > > > > > > > > > JCS.
> > > > > > > > > > > I
> > > > > > > > > > > > > get
> > > > > > > > > > > > > > an
> > > > > > > > > > > > > > > > > empty
> > > > > > > > > > > > > > > > > > >
> > > > > org.apache.commons.jcs.jcache.ImmutableIterable.
> > > > > > The
> > > > > > > > > > > Ehcache
> > > > > > > > > > > > > > provider
> > > > > > > > > > > > > > > > > > > correctly returns a String iterator
with
> > > the
> > > > > > cache
> > > > > > > > > names.
> > > > > > > > > > > My
> > > > > > > > > > > > > > tests
> > > > > > > > > > > > > > > > run
> > > > > > > > > > > > > > > > > > > fine,
> > > > > > > > > > > > > > > > > > > but this is a good way to check that
your
> > > > > > > > configuration
> > > > > > > > > > is
> > > > > > > > > > > > > picked
> > > > > > > > > > > > > > up
> > > > > > > > > > > > > > > > > with
> > > > > > > > > > > > > > > > > > > multiple caches defined.
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > > > > > View this message in context:
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > > > > > > > > > > > > > > > > > > Sent from the TomEE Users mailing list
> > > > archive
> > > > > at
> > > > > > > > > > > Nabble.com.
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > --
> > > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Steven P. Goldsmith
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Steven P. Goldsmith
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Steven P. Goldsmith
> > >
> >
>
>
>
> --
> Steven P. Goldsmith

Re: commons-jcs-jcach getCacheNames not working

Posted by Steve Goldsmith <sg...@gmail.com>.
It looks like your change
https://github.com/apache/commons-jcs/commit/0970e8f84e95d8662a826f8417141e3feffb18ae
expects explicit getCacheManager(URI uri, ClassLoader classLoader,
Properties properties) versus default getCacheManager(). EHcache provider
loads configuration file using the no params method. If you looked for
jcache.ccf in classpath then fall back to DEFAULT_CONFIG?

On Mon, Sep 7, 2015 at 2:17 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:

> snapshot, beta-2 is not released
>
>
> 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-07 10:11 GMT-07:00 Steve Goldsmith <sg...@gmail.com>:
>
> > Should I be using jcs-2.0-beta-2
> > <https://issues.apache.org/jira/browse/JCS/fixforversion/12328850>
> instead
> > of snapshot-2.0.0?
> >
> > On Mon, Sep 7, 2015 at 12:20 PM, Romain Manni-Bucau <
> rmannibucau@gmail.com
> > >
> > wrote:
> >
> > > think you hit the fact the built-in jcache.ccf is used cause before
> your
> > > own one in the classpath,
> https://issues.apache.org/jira/browse/JCS-152
> > > fixes it
> > >
> > >
> > > 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-07 5:45 GMT-07:00 Steve Goldsmith <sg...@gmail.com>:
> > >
> > > > OK, so now that is out of the way, is there a way to configure a
> cache
> > > with
> > > > commons-jcs configuration file? It doesn't seem to pick up my
> > jcache.ccf
> > > in
> > > > the classpath. If that works I can live without getCacheNames picking
> > it
> > > > up.
> > > >
> > > > On Sat, Sep 5, 2015 at 7:19 PM, Romain Manni-Bucau <
> > > rmannibucau@gmail.com>
> > > > wrote:
> > > >
> > > > > Le 5 sept. 2015 06:22, "Steve Goldsmith" <sg...@gmail.com> a
> écrit
> > :
> > > > > >
> > > > > > I believe the behavior of -all- providers should be the same
> from a
> > > > > JCache
> > > > > > perspective. I'm not sure why it matters how I create the cache
> if
> > > it's
> > > > > > visible to JCache API getCacheManager().getCache("testCache")
> then
> > > > > > testCache should show up via getCacheNames. It's not a game
> changer
> > > for
> > > > > me
> > > > > > right now, but what happens when someone relies on the behavior
> of
> > > > > > getCacheNames?
> > > > > >
> > > > >
> > > > > Should be but is not specified.
> > > > >
> > > > > GetCache doesnt create a cache by spec. CreateCache does.
> > > > >
> > > > > > On Fri, Sep 4, 2015 at 5:40 PM, Romain Manni-Bucau <
> > > > > rmannibucau@gmail.com>
> > > > > > wrote:
> > > > > >
> > > > > > > Then you suppose it is created if declare which is another not
> > > > defined
> > > > > > > assumption. Why wouldnt it be lazy?
> > > > > > >
> > > > > > > My point is only you cant rely on what you suppose if you want
> to
> > > > stay
> > > > > > > standard and not to say it is good or bad.
> > > > > > > Le 4 sept. 2015 23:09, "Steve Goldsmith" <sg...@gmail.com> a
> > > écrit
> > > > :
> > > > > > >
> > > > > > > > In my mind it should show up even if it's automatically
> > created.
> > > > > > > > On Sep 4, 2015 3:06 PM, "Romain Manni-Bucau" <
> > > > rmannibucau@gmail.com>
> > > > > > > > wrote:
> > > > > > > >
> > > > > > > > > We can in jcs since we have it but not sure from a API
> point
> > of
> > > > > view
> > > > > > > what
> > > > > > > > > is better - trying to not use test as an excuse ;)
> > > > > > > > > Le 4 sept. 2015 20:42, "Steve Goldsmith" <sgjava@gmail.com
> >
> > a
> > > > > écrit
> > > > > :
> > > > > > > > >
> > > > > > > > > > Yea, just nice to see the cache show up before you use it
> > in
> > > > unit
> > > > > > > tests
> > > > > > > > > :)
> > > > > > > > > > Not a biggie from a normal coding perspective.
> > > > > > > > > >
> > > > > > > > > > On Fri, Sep 4, 2015 at 2:32 PM, Romain Manni-Bucau <
> > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > wrote:
> > > > > > > > > >
> > > > > > > > > > > Not portable behavior then. But nothing in the standard
> > > about
> > > > > the
> > > > > > > > > config
> > > > > > > > > > so
> > > > > > > > > > > looks ok and if your cache is not therz size is empty
> so
> > > nthg
> > > > > > > > blocking
> > > > > > > > > > IMO.
> > > > > > > > > > > Le 4 sept. 2015 20:25, "Steve Goldsmith" <
> > sgjava@gmail.com
> > > >
> > > > a
> > > > > > > écrit
> > > > > > > > :
> > > > > > > > > > >
> > > > > > > > > > > > So, you have to explicitly do the createCache? This
> is
> > > > > different
> > > > > > > > > > behavior
> > > > > > > > > > > > then Ehcache provider. I do not want to code to a
> > > provider
> > > > if
> > > > > > > > > possible.
> > > > > > > > > > > The
> > > > > > > > > > > > weird thing is everything works except getCacheNames,
> > so
> > > > far
> > > > > :)
> > > > > > > > > > > >
> > > > > > > > > > > > On Fri, Sep 4, 2015 at 1:35 PM, Romain Manni-Bucau <
> > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > > Le 4 sept. 2015 19:30, "Steve Goldsmith" <
> > > > sgjava@gmail.com
> > > > > >
> > > > > a
> > > > > > > > > écrit
> > > > > > > > > > :
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > So if I specify jcache.ccf in classpath, then
> > > > technically
> > > > > it
> > > > > > > > > should
> > > > > > > > > > > > show
> > > > > > > > > > > > > up
> > > > > > > > > > > > > > via getCacheNames? It doesn't appear to pick it
> up
> > > from
> > > > > > > > > > > > > > src/main/resources/jcache.ccf.
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > No. If you use one of these cache through jcache
> then
> > > the
> > > > > > > config
> > > > > > > > > > should
> > > > > > > > > > > > get
> > > > > > > > > > > > > used and the cache be listed. If you start and dont
> > use
> > > > > jcache
> > > > > > > -
> > > > > > > > > even
> > > > > > > > > > > > using
> > > > > > > > > > > > > jcs internals - you ll get an empty iterable.
> > > > > > > > > > > > >
> > > > > > > > > > > > > > On Fri, Sep 4, 2015 at 1:17 PM, Romain
> Manni-Bucau
> > <
> > > > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > > Think it does but maybe it takes another one.
> > About
> > > > > > > > > getCacheNames
> > > > > > > > > > > it
> > > > > > > > > > > > is
> > > > > > > > > > > > > > > only *created* caches ie the one jcache saw and
> > not
> > > > the
> > > > > > > ones
> > > > > > > > > jcs
> > > > > > > > > > > has.
> > > > > > > > > > > > > > > Le 4 sept. 2015 19:14, "Steve Goldsmith" <
> > > > > sgjava@gmail.com
> > > > > > > >
> > > > > > > > a
> > > > > > > > > > > écrit
> > > > > > > > > > > > :
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > Looking at
> > > > > > > org.apache.commons.jcs.jcache.JCSCachingProvider
> > > > > > > > > it
> > > > > > > > > > > > > doesn't
> > > > > > > > > > > > > > > > appear to search classpath? Do you have to
> > > > explicitly
> > > > > > > > specify
> > > > > > > > > > > path
> > > > > > > > > > > > in
> > > > > > > > > > > > > > > > getCacheManager call?
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > On Fri, Sep 4, 2015 at 2:40 AM, Romain
> > > Manni-Bucau
> > > > <
> > > > > > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > Hi,
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > final CachingProvider cachingProvider =
> > > > > > > > > > > > > Caching.getCachingProvider();
> > > > > > > > > > > > > > > > > final CacheManager cacheManager =
> > > > > > > > > > > > > cachingProvider.getCacheManager();
> > > > > > > > > > > > > > > > > cacheManager.createCache("c1", new
> > > > > > > > > > MutableConfiguration<String,
> > > > > > > > > > > > > > > > String>());
> > > > > > > > > > > > > > > > > cacheManager.createCache("c2", new
> > > > > > > > > > MutableConfiguration<String,
> > > > > > > > > > > > > > > > String>());
> > > > > > > > > > > > > > > > > final Collection<String> actualNames = new
> > > > > > > > > > > ArrayList<String>(2);
> > > > > > > > > > > > > > > > > for (final String s :
> > > > cacheManager.getCacheNames())
> > > > > > > > > > > > > > > > > {
> > > > > > > > > > > > > > > > >     actualNames.add(s);
> > > > > > > > > > > > > > > > > }
> > > > > > > > > > > > > > > > > assertEquals(2, actualNames.size());
> > > > > > > > > > > > > > > > > assertEquals(new
> HashSet<String>(asList("c1",
> > > > > "c2")),
> > > > > > > new
> > > > > > > > > > > > > > > > > HashSet<String>(actualNames));
> > > > > > > > > > > > > > > > > cachingProvider.close();
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > works fine so you have a setup issue
> > somewhere
> > > -
> > > > or
> > > > > you
> > > > > > > > > dont
> > > > > > > > > > > use
> > > > > > > > > > > > > the
> > > > > > > > > > > > > > > > > same cache manager.
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > 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-04 3:52 GMT+02:00 sgjava <
> > > > sgjava@gmail.com
> > > > > >:
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > getCacheManager().getCacheNames() is not
> > > > working
> > > > > with
> > > > > > > > > JCS.
> > > > > > > > > > I
> > > > > > > > > > > > get
> > > > > > > > > > > > > an
> > > > > > > > > > > > > > > > empty
> > > > > > > > > > > > > > > > > >
> > > > org.apache.commons.jcs.jcache.ImmutableIterable.
> > > > > The
> > > > > > > > > > Ehcache
> > > > > > > > > > > > > provider
> > > > > > > > > > > > > > > > > > correctly returns a String iterator with
> > the
> > > > > cache
> > > > > > > > names.
> > > > > > > > > > My
> > > > > > > > > > > > > tests
> > > > > > > > > > > > > > > run
> > > > > > > > > > > > > > > > > > fine,
> > > > > > > > > > > > > > > > > > but this is a good way to check that your
> > > > > > > configuration
> > > > > > > > > is
> > > > > > > > > > > > picked
> > > > > > > > > > > > > up
> > > > > > > > > > > > > > > > with
> > > > > > > > > > > > > > > > > > multiple caches defined.
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > > > > View this message in context:
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > >
> > > > >
> > > >
> > >
> >
> http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > > > > > > > > > > > > > > > > > Sent from the TomEE Users mailing list
> > > archive
> > > > at
> > > > > > > > > > Nabble.com.
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > --
> > > > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > --
> > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Steven P. Goldsmith
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Steven P. Goldsmith
> > > >
> > >
> >
> >
> >
> > --
> > Steven P. Goldsmith
> >
>



-- 
Steven P. Goldsmith

Re: commons-jcs-jcach getCacheNames not working

Posted by Romain Manni-Bucau <rm...@gmail.com>.
snapshot, beta-2 is not released


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-07 10:11 GMT-07:00 Steve Goldsmith <sg...@gmail.com>:

> Should I be using jcs-2.0-beta-2
> <https://issues.apache.org/jira/browse/JCS/fixforversion/12328850> instead
> of snapshot-2.0.0?
>
> On Mon, Sep 7, 2015 at 12:20 PM, Romain Manni-Bucau <rmannibucau@gmail.com
> >
> wrote:
>
> > think you hit the fact the built-in jcache.ccf is used cause before your
> > own one in the classpath, https://issues.apache.org/jira/browse/JCS-152
> > fixes it
> >
> >
> > 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-07 5:45 GMT-07:00 Steve Goldsmith <sg...@gmail.com>:
> >
> > > OK, so now that is out of the way, is there a way to configure a cache
> > with
> > > commons-jcs configuration file? It doesn't seem to pick up my
> jcache.ccf
> > in
> > > the classpath. If that works I can live without getCacheNames picking
> it
> > > up.
> > >
> > > On Sat, Sep 5, 2015 at 7:19 PM, Romain Manni-Bucau <
> > rmannibucau@gmail.com>
> > > wrote:
> > >
> > > > Le 5 sept. 2015 06:22, "Steve Goldsmith" <sg...@gmail.com> a écrit
> :
> > > > >
> > > > > I believe the behavior of -all- providers should be the same from a
> > > > JCache
> > > > > perspective. I'm not sure why it matters how I create the cache if
> > it's
> > > > > visible to JCache API getCacheManager().getCache("testCache") then
> > > > > testCache should show up via getCacheNames. It's not a game changer
> > for
> > > > me
> > > > > right now, but what happens when someone relies on the behavior of
> > > > > getCacheNames?
> > > > >
> > > >
> > > > Should be but is not specified.
> > > >
> > > > GetCache doesnt create a cache by spec. CreateCache does.
> > > >
> > > > > On Fri, Sep 4, 2015 at 5:40 PM, Romain Manni-Bucau <
> > > > rmannibucau@gmail.com>
> > > > > wrote:
> > > > >
> > > > > > Then you suppose it is created if declare which is another not
> > > defined
> > > > > > assumption. Why wouldnt it be lazy?
> > > > > >
> > > > > > My point is only you cant rely on what you suppose if you want to
> > > stay
> > > > > > standard and not to say it is good or bad.
> > > > > > Le 4 sept. 2015 23:09, "Steve Goldsmith" <sg...@gmail.com> a
> > écrit
> > > :
> > > > > >
> > > > > > > In my mind it should show up even if it's automatically
> created.
> > > > > > > On Sep 4, 2015 3:06 PM, "Romain Manni-Bucau" <
> > > rmannibucau@gmail.com>
> > > > > > > wrote:
> > > > > > >
> > > > > > > > We can in jcs since we have it but not sure from a API point
> of
> > > > view
> > > > > > what
> > > > > > > > is better - trying to not use test as an excuse ;)
> > > > > > > > Le 4 sept. 2015 20:42, "Steve Goldsmith" <sg...@gmail.com>
> a
> > > > écrit
> > > > :
> > > > > > > >
> > > > > > > > > Yea, just nice to see the cache show up before you use it
> in
> > > unit
> > > > > > tests
> > > > > > > > :)
> > > > > > > > > Not a biggie from a normal coding perspective.
> > > > > > > > >
> > > > > > > > > On Fri, Sep 4, 2015 at 2:32 PM, Romain Manni-Bucau <
> > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > Not portable behavior then. But nothing in the standard
> > about
> > > > the
> > > > > > > > config
> > > > > > > > > so
> > > > > > > > > > looks ok and if your cache is not therz size is empty so
> > nthg
> > > > > > > blocking
> > > > > > > > > IMO.
> > > > > > > > > > Le 4 sept. 2015 20:25, "Steve Goldsmith" <
> sgjava@gmail.com
> > >
> > > a
> > > > > > écrit
> > > > > > > :
> > > > > > > > > >
> > > > > > > > > > > So, you have to explicitly do the createCache? This is
> > > > different
> > > > > > > > > behavior
> > > > > > > > > > > then Ehcache provider. I do not want to code to a
> > provider
> > > if
> > > > > > > > possible.
> > > > > > > > > > The
> > > > > > > > > > > weird thing is everything works except getCacheNames,
> so
> > > far
> > > > :)
> > > > > > > > > > >
> > > > > > > > > > > On Fri, Sep 4, 2015 at 1:35 PM, Romain Manni-Bucau <
> > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > wrote:
> > > > > > > > > > >
> > > > > > > > > > > > Le 4 sept. 2015 19:30, "Steve Goldsmith" <
> > > sgjava@gmail.com
> > > > >
> > > > a
> > > > > > > > écrit
> > > > > > > > > :
> > > > > > > > > > > > >
> > > > > > > > > > > > > So if I specify jcache.ccf in classpath, then
> > > technically
> > > > it
> > > > > > > > should
> > > > > > > > > > > show
> > > > > > > > > > > > up
> > > > > > > > > > > > > via getCacheNames? It doesn't appear to pick it up
> > from
> > > > > > > > > > > > > src/main/resources/jcache.ccf.
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > No. If you use one of these cache through jcache then
> > the
> > > > > > config
> > > > > > > > > should
> > > > > > > > > > > get
> > > > > > > > > > > > used and the cache be listed. If you start and dont
> use
> > > > jcache
> > > > > > -
> > > > > > > > even
> > > > > > > > > > > using
> > > > > > > > > > > > jcs internals - you ll get an empty iterable.
> > > > > > > > > > > >
> > > > > > > > > > > > > On Fri, Sep 4, 2015 at 1:17 PM, Romain Manni-Bucau
> <
> > > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > > wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > > > Think it does but maybe it takes another one.
> About
> > > > > > > > getCacheNames
> > > > > > > > > > it
> > > > > > > > > > > is
> > > > > > > > > > > > > > only *created* caches ie the one jcache saw and
> not
> > > the
> > > > > > ones
> > > > > > > > jcs
> > > > > > > > > > has.
> > > > > > > > > > > > > > Le 4 sept. 2015 19:14, "Steve Goldsmith" <
> > > > sgjava@gmail.com
> > > > > > >
> > > > > > > a
> > > > > > > > > > écrit
> > > > > > > > > > > :
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > > Looking at
> > > > > > org.apache.commons.jcs.jcache.JCSCachingProvider
> > > > > > > > it
> > > > > > > > > > > > doesn't
> > > > > > > > > > > > > > > appear to search classpath? Do you have to
> > > explicitly
> > > > > > > specify
> > > > > > > > > > path
> > > > > > > > > > > in
> > > > > > > > > > > > > > > getCacheManager call?
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > On Fri, Sep 4, 2015 at 2:40 AM, Romain
> > Manni-Bucau
> > > <
> > > > > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > Hi,
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > final CachingProvider cachingProvider =
> > > > > > > > > > > > Caching.getCachingProvider();
> > > > > > > > > > > > > > > > final CacheManager cacheManager =
> > > > > > > > > > > > cachingProvider.getCacheManager();
> > > > > > > > > > > > > > > > cacheManager.createCache("c1", new
> > > > > > > > > MutableConfiguration<String,
> > > > > > > > > > > > > > > String>());
> > > > > > > > > > > > > > > > cacheManager.createCache("c2", new
> > > > > > > > > MutableConfiguration<String,
> > > > > > > > > > > > > > > String>());
> > > > > > > > > > > > > > > > final Collection<String> actualNames = new
> > > > > > > > > > ArrayList<String>(2);
> > > > > > > > > > > > > > > > for (final String s :
> > > cacheManager.getCacheNames())
> > > > > > > > > > > > > > > > {
> > > > > > > > > > > > > > > >     actualNames.add(s);
> > > > > > > > > > > > > > > > }
> > > > > > > > > > > > > > > > assertEquals(2, actualNames.size());
> > > > > > > > > > > > > > > > assertEquals(new HashSet<String>(asList("c1",
> > > > "c2")),
> > > > > > new
> > > > > > > > > > > > > > > > HashSet<String>(actualNames));
> > > > > > > > > > > > > > > > cachingProvider.close();
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > works fine so you have a setup issue
> somewhere
> > -
> > > or
> > > > you
> > > > > > > > dont
> > > > > > > > > > use
> > > > > > > > > > > > the
> > > > > > > > > > > > > > > > same cache manager.
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > 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-04 3:52 GMT+02:00 sgjava <
> > > sgjava@gmail.com
> > > > >:
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > getCacheManager().getCacheNames() is not
> > > working
> > > > with
> > > > > > > > JCS.
> > > > > > > > > I
> > > > > > > > > > > get
> > > > > > > > > > > > an
> > > > > > > > > > > > > > > empty
> > > > > > > > > > > > > > > > >
> > > org.apache.commons.jcs.jcache.ImmutableIterable.
> > > > The
> > > > > > > > > Ehcache
> > > > > > > > > > > > provider
> > > > > > > > > > > > > > > > > correctly returns a String iterator with
> the
> > > > cache
> > > > > > > names.
> > > > > > > > > My
> > > > > > > > > > > > tests
> > > > > > > > > > > > > > run
> > > > > > > > > > > > > > > > > fine,
> > > > > > > > > > > > > > > > > but this is a good way to check that your
> > > > > > configuration
> > > > > > > > is
> > > > > > > > > > > picked
> > > > > > > > > > > > up
> > > > > > > > > > > > > > > with
> > > > > > > > > > > > > > > > > multiple caches defined.
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > > > View this message in context:
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > >
> > > >
> > >
> >
> http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > > > > > > > > > > > > > > > > Sent from the TomEE Users mailing list
> > archive
> > > at
> > > > > > > > > Nabble.com.
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > --
> > > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > Steven P. Goldsmith
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Steven P. Goldsmith
> > > >
> > >
> > >
> > >
> > > --
> > > Steven P. Goldsmith
> > >
> >
>
>
>
> --
> Steven P. Goldsmith
>

Re: commons-jcs-jcach getCacheNames not working

Posted by Steve Goldsmith <sg...@gmail.com>.
Should I be using jcs-2.0-beta-2
<https://issues.apache.org/jira/browse/JCS/fixforversion/12328850> instead
of snapshot-2.0.0?

On Mon, Sep 7, 2015 at 12:20 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:

> think you hit the fact the built-in jcache.ccf is used cause before your
> own one in the classpath, https://issues.apache.org/jira/browse/JCS-152
> fixes it
>
>
> 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-07 5:45 GMT-07:00 Steve Goldsmith <sg...@gmail.com>:
>
> > OK, so now that is out of the way, is there a way to configure a cache
> with
> > commons-jcs configuration file? It doesn't seem to pick up my jcache.ccf
> in
> > the classpath. If that works I can live without getCacheNames picking it
> > up.
> >
> > On Sat, Sep 5, 2015 at 7:19 PM, Romain Manni-Bucau <
> rmannibucau@gmail.com>
> > wrote:
> >
> > > Le 5 sept. 2015 06:22, "Steve Goldsmith" <sg...@gmail.com> a écrit :
> > > >
> > > > I believe the behavior of -all- providers should be the same from a
> > > JCache
> > > > perspective. I'm not sure why it matters how I create the cache if
> it's
> > > > visible to JCache API getCacheManager().getCache("testCache") then
> > > > testCache should show up via getCacheNames. It's not a game changer
> for
> > > me
> > > > right now, but what happens when someone relies on the behavior of
> > > > getCacheNames?
> > > >
> > >
> > > Should be but is not specified.
> > >
> > > GetCache doesnt create a cache by spec. CreateCache does.
> > >
> > > > On Fri, Sep 4, 2015 at 5:40 PM, Romain Manni-Bucau <
> > > rmannibucau@gmail.com>
> > > > wrote:
> > > >
> > > > > Then you suppose it is created if declare which is another not
> > defined
> > > > > assumption. Why wouldnt it be lazy?
> > > > >
> > > > > My point is only you cant rely on what you suppose if you want to
> > stay
> > > > > standard and not to say it is good or bad.
> > > > > Le 4 sept. 2015 23:09, "Steve Goldsmith" <sg...@gmail.com> a
> écrit
> > :
> > > > >
> > > > > > In my mind it should show up even if it's automatically created.
> > > > > > On Sep 4, 2015 3:06 PM, "Romain Manni-Bucau" <
> > rmannibucau@gmail.com>
> > > > > > wrote:
> > > > > >
> > > > > > > We can in jcs since we have it but not sure from a API point of
> > > view
> > > > > what
> > > > > > > is better - trying to not use test as an excuse ;)
> > > > > > > Le 4 sept. 2015 20:42, "Steve Goldsmith" <sg...@gmail.com> a
> > > écrit
> > > :
> > > > > > >
> > > > > > > > Yea, just nice to see the cache show up before you use it in
> > unit
> > > > > tests
> > > > > > > :)
> > > > > > > > Not a biggie from a normal coding perspective.
> > > > > > > >
> > > > > > > > On Fri, Sep 4, 2015 at 2:32 PM, Romain Manni-Bucau <
> > > > > > > rmannibucau@gmail.com>
> > > > > > > > wrote:
> > > > > > > >
> > > > > > > > > Not portable behavior then. But nothing in the standard
> about
> > > the
> > > > > > > config
> > > > > > > > so
> > > > > > > > > looks ok and if your cache is not therz size is empty so
> nthg
> > > > > > blocking
> > > > > > > > IMO.
> > > > > > > > > Le 4 sept. 2015 20:25, "Steve Goldsmith" <sgjava@gmail.com
> >
> > a
> > > > > écrit
> > > > > > :
> > > > > > > > >
> > > > > > > > > > So, you have to explicitly do the createCache? This is
> > > different
> > > > > > > > behavior
> > > > > > > > > > then Ehcache provider. I do not want to code to a
> provider
> > if
> > > > > > > possible.
> > > > > > > > > The
> > > > > > > > > > weird thing is everything works except getCacheNames, so
> > far
> > > :)
> > > > > > > > > >
> > > > > > > > > > On Fri, Sep 4, 2015 at 1:35 PM, Romain Manni-Bucau <
> > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > wrote:
> > > > > > > > > >
> > > > > > > > > > > Le 4 sept. 2015 19:30, "Steve Goldsmith" <
> > sgjava@gmail.com
> > > >
> > > a
> > > > > > > écrit
> > > > > > > > :
> > > > > > > > > > > >
> > > > > > > > > > > > So if I specify jcache.ccf in classpath, then
> > technically
> > > it
> > > > > > > should
> > > > > > > > > > show
> > > > > > > > > > > up
> > > > > > > > > > > > via getCacheNames? It doesn't appear to pick it up
> from
> > > > > > > > > > > > src/main/resources/jcache.ccf.
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > No. If you use one of these cache through jcache then
> the
> > > > > config
> > > > > > > > should
> > > > > > > > > > get
> > > > > > > > > > > used and the cache be listed. If you start and dont use
> > > jcache
> > > > > -
> > > > > > > even
> > > > > > > > > > using
> > > > > > > > > > > jcs internals - you ll get an empty iterable.
> > > > > > > > > > >
> > > > > > > > > > > > On Fri, Sep 4, 2015 at 1:17 PM, Romain Manni-Bucau <
> > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > > Think it does but maybe it takes another one. About
> > > > > > > getCacheNames
> > > > > > > > > it
> > > > > > > > > > is
> > > > > > > > > > > > > only *created* caches ie the one jcache saw and not
> > the
> > > > > ones
> > > > > > > jcs
> > > > > > > > > has.
> > > > > > > > > > > > > Le 4 sept. 2015 19:14, "Steve Goldsmith" <
> > > sgjava@gmail.com
> > > > > >
> > > > > > a
> > > > > > > > > écrit
> > > > > > > > > > :
> > > > > > > > > > > > >
> > > > > > > > > > > > > > Looking at
> > > > > org.apache.commons.jcs.jcache.JCSCachingProvider
> > > > > > > it
> > > > > > > > > > > doesn't
> > > > > > > > > > > > > > appear to search classpath? Do you have to
> > explicitly
> > > > > > specify
> > > > > > > > > path
> > > > > > > > > > in
> > > > > > > > > > > > > > getCacheManager call?
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > On Fri, Sep 4, 2015 at 2:40 AM, Romain
> Manni-Bucau
> > <
> > > > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > > Hi,
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > final CachingProvider cachingProvider =
> > > > > > > > > > > Caching.getCachingProvider();
> > > > > > > > > > > > > > > final CacheManager cacheManager =
> > > > > > > > > > > cachingProvider.getCacheManager();
> > > > > > > > > > > > > > > cacheManager.createCache("c1", new
> > > > > > > > MutableConfiguration<String,
> > > > > > > > > > > > > > String>());
> > > > > > > > > > > > > > > cacheManager.createCache("c2", new
> > > > > > > > MutableConfiguration<String,
> > > > > > > > > > > > > > String>());
> > > > > > > > > > > > > > > final Collection<String> actualNames = new
> > > > > > > > > ArrayList<String>(2);
> > > > > > > > > > > > > > > for (final String s :
> > cacheManager.getCacheNames())
> > > > > > > > > > > > > > > {
> > > > > > > > > > > > > > >     actualNames.add(s);
> > > > > > > > > > > > > > > }
> > > > > > > > > > > > > > > assertEquals(2, actualNames.size());
> > > > > > > > > > > > > > > assertEquals(new HashSet<String>(asList("c1",
> > > "c2")),
> > > > > new
> > > > > > > > > > > > > > > HashSet<String>(actualNames));
> > > > > > > > > > > > > > > cachingProvider.close();
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > works fine so you have a setup issue somewhere
> -
> > or
> > > you
> > > > > > > dont
> > > > > > > > > use
> > > > > > > > > > > the
> > > > > > > > > > > > > > > same cache manager.
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > 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-04 3:52 GMT+02:00 sgjava <
> > sgjava@gmail.com
> > > >:
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > getCacheManager().getCacheNames() is not
> > working
> > > with
> > > > > > > JCS.
> > > > > > > > I
> > > > > > > > > > get
> > > > > > > > > > > an
> > > > > > > > > > > > > > empty
> > > > > > > > > > > > > > > >
> > org.apache.commons.jcs.jcache.ImmutableIterable.
> > > The
> > > > > > > > Ehcache
> > > > > > > > > > > provider
> > > > > > > > > > > > > > > > correctly returns a String iterator with the
> > > cache
> > > > > > names.
> > > > > > > > My
> > > > > > > > > > > tests
> > > > > > > > > > > > > run
> > > > > > > > > > > > > > > > fine,
> > > > > > > > > > > > > > > > but this is a good way to check that your
> > > > > configuration
> > > > > > > is
> > > > > > > > > > picked
> > > > > > > > > > > up
> > > > > > > > > > > > > > with
> > > > > > > > > > > > > > > > multiple caches defined.
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > > View this message in context:
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > >
> > >
> >
> http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > > > > > > > > > > > > > > > Sent from the TomEE Users mailing list
> archive
> > at
> > > > > > > > Nabble.com.
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > --
> > > > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > --
> > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > Steven P. Goldsmith
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Steven P. Goldsmith
> > >
> >
> >
> >
> > --
> > Steven P. Goldsmith
> >
>



-- 
Steven P. Goldsmith

Re: commons-jcs-jcach getCacheNames not working

Posted by Romain Manni-Bucau <rm...@gmail.com>.
think you hit the fact the built-in jcache.ccf is used cause before your
own one in the classpath, https://issues.apache.org/jira/browse/JCS-152
fixes it


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-07 5:45 GMT-07:00 Steve Goldsmith <sg...@gmail.com>:

> OK, so now that is out of the way, is there a way to configure a cache with
> commons-jcs configuration file? It doesn't seem to pick up my jcache.ccf in
> the classpath. If that works I can live without getCacheNames picking it
> up.
>
> On Sat, Sep 5, 2015 at 7:19 PM, Romain Manni-Bucau <rm...@gmail.com>
> wrote:
>
> > Le 5 sept. 2015 06:22, "Steve Goldsmith" <sg...@gmail.com> a écrit :
> > >
> > > I believe the behavior of -all- providers should be the same from a
> > JCache
> > > perspective. I'm not sure why it matters how I create the cache if it's
> > > visible to JCache API getCacheManager().getCache("testCache") then
> > > testCache should show up via getCacheNames. It's not a game changer for
> > me
> > > right now, but what happens when someone relies on the behavior of
> > > getCacheNames?
> > >
> >
> > Should be but is not specified.
> >
> > GetCache doesnt create a cache by spec. CreateCache does.
> >
> > > On Fri, Sep 4, 2015 at 5:40 PM, Romain Manni-Bucau <
> > rmannibucau@gmail.com>
> > > wrote:
> > >
> > > > Then you suppose it is created if declare which is another not
> defined
> > > > assumption. Why wouldnt it be lazy?
> > > >
> > > > My point is only you cant rely on what you suppose if you want to
> stay
> > > > standard and not to say it is good or bad.
> > > > Le 4 sept. 2015 23:09, "Steve Goldsmith" <sg...@gmail.com> a écrit
> :
> > > >
> > > > > In my mind it should show up even if it's automatically created.
> > > > > On Sep 4, 2015 3:06 PM, "Romain Manni-Bucau" <
> rmannibucau@gmail.com>
> > > > > wrote:
> > > > >
> > > > > > We can in jcs since we have it but not sure from a API point of
> > view
> > > > what
> > > > > > is better - trying to not use test as an excuse ;)
> > > > > > Le 4 sept. 2015 20:42, "Steve Goldsmith" <sg...@gmail.com> a
> > écrit
> > :
> > > > > >
> > > > > > > Yea, just nice to see the cache show up before you use it in
> unit
> > > > tests
> > > > > > :)
> > > > > > > Not a biggie from a normal coding perspective.
> > > > > > >
> > > > > > > On Fri, Sep 4, 2015 at 2:32 PM, Romain Manni-Bucau <
> > > > > > rmannibucau@gmail.com>
> > > > > > > wrote:
> > > > > > >
> > > > > > > > Not portable behavior then. But nothing in the standard about
> > the
> > > > > > config
> > > > > > > so
> > > > > > > > looks ok and if your cache is not therz size is empty so nthg
> > > > > blocking
> > > > > > > IMO.
> > > > > > > > Le 4 sept. 2015 20:25, "Steve Goldsmith" <sg...@gmail.com>
> a
> > > > écrit
> > > > > :
> > > > > > > >
> > > > > > > > > So, you have to explicitly do the createCache? This is
> > different
> > > > > > > behavior
> > > > > > > > > then Ehcache provider. I do not want to code to a provider
> if
> > > > > > possible.
> > > > > > > > The
> > > > > > > > > weird thing is everything works except getCacheNames, so
> far
> > :)
> > > > > > > > >
> > > > > > > > > On Fri, Sep 4, 2015 at 1:35 PM, Romain Manni-Bucau <
> > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > Le 4 sept. 2015 19:30, "Steve Goldsmith" <
> sgjava@gmail.com
> > >
> > a
> > > > > > écrit
> > > > > > > :
> > > > > > > > > > >
> > > > > > > > > > > So if I specify jcache.ccf in classpath, then
> technically
> > it
> > > > > > should
> > > > > > > > > show
> > > > > > > > > > up
> > > > > > > > > > > via getCacheNames? It doesn't appear to pick it up from
> > > > > > > > > > > src/main/resources/jcache.ccf.
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > No. If you use one of these cache through jcache then the
> > > > config
> > > > > > > should
> > > > > > > > > get
> > > > > > > > > > used and the cache be listed. If you start and dont use
> > jcache
> > > > -
> > > > > > even
> > > > > > > > > using
> > > > > > > > > > jcs internals - you ll get an empty iterable.
> > > > > > > > > >
> > > > > > > > > > > On Fri, Sep 4, 2015 at 1:17 PM, Romain Manni-Bucau <
> > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > wrote:
> > > > > > > > > > >
> > > > > > > > > > > > Think it does but maybe it takes another one. About
> > > > > > getCacheNames
> > > > > > > > it
> > > > > > > > > is
> > > > > > > > > > > > only *created* caches ie the one jcache saw and not
> the
> > > > ones
> > > > > > jcs
> > > > > > > > has.
> > > > > > > > > > > > Le 4 sept. 2015 19:14, "Steve Goldsmith" <
> > sgjava@gmail.com
> > > > >
> > > > > a
> > > > > > > > écrit
> > > > > > > > > :
> > > > > > > > > > > >
> > > > > > > > > > > > > Looking at
> > > > org.apache.commons.jcs.jcache.JCSCachingProvider
> > > > > > it
> > > > > > > > > > doesn't
> > > > > > > > > > > > > appear to search classpath? Do you have to
> explicitly
> > > > > specify
> > > > > > > > path
> > > > > > > > > in
> > > > > > > > > > > > > getCacheManager call?
> > > > > > > > > > > > >
> > > > > > > > > > > > > On Fri, Sep 4, 2015 at 2:40 AM, Romain Manni-Bucau
> <
> > > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > > wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > > > Hi,
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > final CachingProvider cachingProvider =
> > > > > > > > > > Caching.getCachingProvider();
> > > > > > > > > > > > > > final CacheManager cacheManager =
> > > > > > > > > > cachingProvider.getCacheManager();
> > > > > > > > > > > > > > cacheManager.createCache("c1", new
> > > > > > > MutableConfiguration<String,
> > > > > > > > > > > > > String>());
> > > > > > > > > > > > > > cacheManager.createCache("c2", new
> > > > > > > MutableConfiguration<String,
> > > > > > > > > > > > > String>());
> > > > > > > > > > > > > > final Collection<String> actualNames = new
> > > > > > > > ArrayList<String>(2);
> > > > > > > > > > > > > > for (final String s :
> cacheManager.getCacheNames())
> > > > > > > > > > > > > > {
> > > > > > > > > > > > > >     actualNames.add(s);
> > > > > > > > > > > > > > }
> > > > > > > > > > > > > > assertEquals(2, actualNames.size());
> > > > > > > > > > > > > > assertEquals(new HashSet<String>(asList("c1",
> > "c2")),
> > > > new
> > > > > > > > > > > > > > HashSet<String>(actualNames));
> > > > > > > > > > > > > > cachingProvider.close();
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > works fine so you have a setup issue somewhere -
> or
> > you
> > > > > > dont
> > > > > > > > use
> > > > > > > > > > the
> > > > > > > > > > > > > > same cache manager.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > 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-04 3:52 GMT+02:00 sgjava <
> sgjava@gmail.com
> > >:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > > getCacheManager().getCacheNames() is not
> working
> > with
> > > > > > JCS.
> > > > > > > I
> > > > > > > > > get
> > > > > > > > > > an
> > > > > > > > > > > > > empty
> > > > > > > > > > > > > > >
> org.apache.commons.jcs.jcache.ImmutableIterable.
> > The
> > > > > > > Ehcache
> > > > > > > > > > provider
> > > > > > > > > > > > > > > correctly returns a String iterator with the
> > cache
> > > > > names.
> > > > > > > My
> > > > > > > > > > tests
> > > > > > > > > > > > run
> > > > > > > > > > > > > > > fine,
> > > > > > > > > > > > > > > but this is a good way to check that your
> > > > configuration
> > > > > > is
> > > > > > > > > picked
> > > > > > > > > > up
> > > > > > > > > > > > > with
> > > > > > > > > > > > > > > multiple caches defined.
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > View this message in context:
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> >
> >
> http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > > > > > > > > > > > > > > Sent from the TomEE Users mailing list archive
> at
> > > > > > > Nabble.com.
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > --
> > > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > Steven P. Goldsmith
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Steven P. Goldsmith
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Steven P. Goldsmith
> >
>
>
>
> --
> Steven P. Goldsmith
>

Re: commons-jcs-jcach getCacheNames not working

Posted by Steve Goldsmith <sg...@gmail.com>.
OK, so now that is out of the way, is there a way to configure a cache with
commons-jcs configuration file? It doesn't seem to pick up my jcache.ccf in
the classpath. If that works I can live without getCacheNames picking it up.

On Sat, Sep 5, 2015 at 7:19 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:

> Le 5 sept. 2015 06:22, "Steve Goldsmith" <sg...@gmail.com> a écrit :
> >
> > I believe the behavior of -all- providers should be the same from a
> JCache
> > perspective. I'm not sure why it matters how I create the cache if it's
> > visible to JCache API getCacheManager().getCache("testCache") then
> > testCache should show up via getCacheNames. It's not a game changer for
> me
> > right now, but what happens when someone relies on the behavior of
> > getCacheNames?
> >
>
> Should be but is not specified.
>
> GetCache doesnt create a cache by spec. CreateCache does.
>
> > On Fri, Sep 4, 2015 at 5:40 PM, Romain Manni-Bucau <
> rmannibucau@gmail.com>
> > wrote:
> >
> > > Then you suppose it is created if declare which is another not defined
> > > assumption. Why wouldnt it be lazy?
> > >
> > > My point is only you cant rely on what you suppose if you want to stay
> > > standard and not to say it is good or bad.
> > > Le 4 sept. 2015 23:09, "Steve Goldsmith" <sg...@gmail.com> a écrit :
> > >
> > > > In my mind it should show up even if it's automatically created.
> > > > On Sep 4, 2015 3:06 PM, "Romain Manni-Bucau" <rm...@gmail.com>
> > > > wrote:
> > > >
> > > > > We can in jcs since we have it but not sure from a API point of
> view
> > > what
> > > > > is better - trying to not use test as an excuse ;)
> > > > > Le 4 sept. 2015 20:42, "Steve Goldsmith" <sg...@gmail.com> a
> écrit
> :
> > > > >
> > > > > > Yea, just nice to see the cache show up before you use it in unit
> > > tests
> > > > > :)
> > > > > > Not a biggie from a normal coding perspective.
> > > > > >
> > > > > > On Fri, Sep 4, 2015 at 2:32 PM, Romain Manni-Bucau <
> > > > > rmannibucau@gmail.com>
> > > > > > wrote:
> > > > > >
> > > > > > > Not portable behavior then. But nothing in the standard about
> the
> > > > > config
> > > > > > so
> > > > > > > looks ok and if your cache is not therz size is empty so nthg
> > > > blocking
> > > > > > IMO.
> > > > > > > Le 4 sept. 2015 20:25, "Steve Goldsmith" <sg...@gmail.com> a
> > > écrit
> > > > :
> > > > > > >
> > > > > > > > So, you have to explicitly do the createCache? This is
> different
> > > > > > behavior
> > > > > > > > then Ehcache provider. I do not want to code to a provider if
> > > > > possible.
> > > > > > > The
> > > > > > > > weird thing is everything works except getCacheNames, so far
> :)
> > > > > > > >
> > > > > > > > On Fri, Sep 4, 2015 at 1:35 PM, Romain Manni-Bucau <
> > > > > > > rmannibucau@gmail.com>
> > > > > > > > wrote:
> > > > > > > >
> > > > > > > > > Le 4 sept. 2015 19:30, "Steve Goldsmith" <sgjava@gmail.com
> >
> a
> > > > > écrit
> > > > > > :
> > > > > > > > > >
> > > > > > > > > > So if I specify jcache.ccf in classpath, then technically
> it
> > > > > should
> > > > > > > > show
> > > > > > > > > up
> > > > > > > > > > via getCacheNames? It doesn't appear to pick it up from
> > > > > > > > > > src/main/resources/jcache.ccf.
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > > No. If you use one of these cache through jcache then the
> > > config
> > > > > > should
> > > > > > > > get
> > > > > > > > > used and the cache be listed. If you start and dont use
> jcache
> > > -
> > > > > even
> > > > > > > > using
> > > > > > > > > jcs internals - you ll get an empty iterable.
> > > > > > > > >
> > > > > > > > > > On Fri, Sep 4, 2015 at 1:17 PM, Romain Manni-Bucau <
> > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > wrote:
> > > > > > > > > >
> > > > > > > > > > > Think it does but maybe it takes another one. About
> > > > > getCacheNames
> > > > > > > it
> > > > > > > > is
> > > > > > > > > > > only *created* caches ie the one jcache saw and not the
> > > ones
> > > > > jcs
> > > > > > > has.
> > > > > > > > > > > Le 4 sept. 2015 19:14, "Steve Goldsmith" <
> sgjava@gmail.com
> > > >
> > > > a
> > > > > > > écrit
> > > > > > > > :
> > > > > > > > > > >
> > > > > > > > > > > > Looking at
> > > org.apache.commons.jcs.jcache.JCSCachingProvider
> > > > > it
> > > > > > > > > doesn't
> > > > > > > > > > > > appear to search classpath? Do you have to explicitly
> > > > specify
> > > > > > > path
> > > > > > > > in
> > > > > > > > > > > > getCacheManager call?
> > > > > > > > > > > >
> > > > > > > > > > > > On Fri, Sep 4, 2015 at 2:40 AM, Romain Manni-Bucau <
> > > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > > wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > > Hi,
> > > > > > > > > > > > >
> > > > > > > > > > > > > final CachingProvider cachingProvider =
> > > > > > > > > Caching.getCachingProvider();
> > > > > > > > > > > > > final CacheManager cacheManager =
> > > > > > > > > cachingProvider.getCacheManager();
> > > > > > > > > > > > > cacheManager.createCache("c1", new
> > > > > > MutableConfiguration<String,
> > > > > > > > > > > > String>());
> > > > > > > > > > > > > cacheManager.createCache("c2", new
> > > > > > MutableConfiguration<String,
> > > > > > > > > > > > String>());
> > > > > > > > > > > > > final Collection<String> actualNames = new
> > > > > > > ArrayList<String>(2);
> > > > > > > > > > > > > for (final String s : cacheManager.getCacheNames())
> > > > > > > > > > > > > {
> > > > > > > > > > > > >     actualNames.add(s);
> > > > > > > > > > > > > }
> > > > > > > > > > > > > assertEquals(2, actualNames.size());
> > > > > > > > > > > > > assertEquals(new HashSet<String>(asList("c1",
> "c2")),
> > > new
> > > > > > > > > > > > > HashSet<String>(actualNames));
> > > > > > > > > > > > > cachingProvider.close();
> > > > > > > > > > > > >
> > > > > > > > > > > > > works fine so you have a setup issue somewhere - or
> you
> > > > > dont
> > > > > > > use
> > > > > > > > > the
> > > > > > > > > > > > > same cache manager.
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > 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-04 3:52 GMT+02:00 sgjava <sgjava@gmail.com
> >:
> > > > > > > > > > > > >
> > > > > > > > > > > > > > getCacheManager().getCacheNames() is not working
> with
> > > > > JCS.
> > > > > > I
> > > > > > > > get
> > > > > > > > > an
> > > > > > > > > > > > empty
> > > > > > > > > > > > > > org.apache.commons.jcs.jcache.ImmutableIterable.
> The
> > > > > > Ehcache
> > > > > > > > > provider
> > > > > > > > > > > > > > correctly returns a String iterator with the
> cache
> > > > names.
> > > > > > My
> > > > > > > > > tests
> > > > > > > > > > > run
> > > > > > > > > > > > > > fine,
> > > > > > > > > > > > > > but this is a good way to check that your
> > > configuration
> > > > > is
> > > > > > > > picked
> > > > > > > > > up
> > > > > > > > > > > > with
> > > > > > > > > > > > > > multiple caches defined.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > --
> > > > > > > > > > > > > > View this message in context:
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
>
> http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > > > > > > > > > > > > > Sent from the TomEE Users mailing list archive at
> > > > > > Nabble.com.
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > --
> > > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > Steven P. Goldsmith
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > Steven P. Goldsmith
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Steven P. Goldsmith
> > > > > >
> > > > >
> > > >
> > >
> >
> >
> >
> > --
> > Steven P. Goldsmith
>



-- 
Steven P. Goldsmith

Re: commons-jcs-jcach getCacheNames not working

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Le 5 sept. 2015 06:22, "Steve Goldsmith" <sg...@gmail.com> a écrit :
>
> I believe the behavior of -all- providers should be the same from a JCache
> perspective. I'm not sure why it matters how I create the cache if it's
> visible to JCache API getCacheManager().getCache("testCache") then
> testCache should show up via getCacheNames. It's not a game changer for me
> right now, but what happens when someone relies on the behavior of
> getCacheNames?
>

Should be but is not specified.

GetCache doesnt create a cache by spec. CreateCache does.

> On Fri, Sep 4, 2015 at 5:40 PM, Romain Manni-Bucau <rm...@gmail.com>
> wrote:
>
> > Then you suppose it is created if declare which is another not defined
> > assumption. Why wouldnt it be lazy?
> >
> > My point is only you cant rely on what you suppose if you want to stay
> > standard and not to say it is good or bad.
> > Le 4 sept. 2015 23:09, "Steve Goldsmith" <sg...@gmail.com> a écrit :
> >
> > > In my mind it should show up even if it's automatically created.
> > > On Sep 4, 2015 3:06 PM, "Romain Manni-Bucau" <rm...@gmail.com>
> > > wrote:
> > >
> > > > We can in jcs since we have it but not sure from a API point of view
> > what
> > > > is better - trying to not use test as an excuse ;)
> > > > Le 4 sept. 2015 20:42, "Steve Goldsmith" <sg...@gmail.com> a écrit
:
> > > >
> > > > > Yea, just nice to see the cache show up before you use it in unit
> > tests
> > > > :)
> > > > > Not a biggie from a normal coding perspective.
> > > > >
> > > > > On Fri, Sep 4, 2015 at 2:32 PM, Romain Manni-Bucau <
> > > > rmannibucau@gmail.com>
> > > > > wrote:
> > > > >
> > > > > > Not portable behavior then. But nothing in the standard about
the
> > > > config
> > > > > so
> > > > > > looks ok and if your cache is not therz size is empty so nthg
> > > blocking
> > > > > IMO.
> > > > > > Le 4 sept. 2015 20:25, "Steve Goldsmith" <sg...@gmail.com> a
> > écrit
> > > :
> > > > > >
> > > > > > > So, you have to explicitly do the createCache? This is
different
> > > > > behavior
> > > > > > > then Ehcache provider. I do not want to code to a provider if
> > > > possible.
> > > > > > The
> > > > > > > weird thing is everything works except getCacheNames, so far
:)
> > > > > > >
> > > > > > > On Fri, Sep 4, 2015 at 1:35 PM, Romain Manni-Bucau <
> > > > > > rmannibucau@gmail.com>
> > > > > > > wrote:
> > > > > > >
> > > > > > > > Le 4 sept. 2015 19:30, "Steve Goldsmith" <sg...@gmail.com>
a
> > > > écrit
> > > > > :
> > > > > > > > >
> > > > > > > > > So if I specify jcache.ccf in classpath, then technically
it
> > > > should
> > > > > > > show
> > > > > > > > up
> > > > > > > > > via getCacheNames? It doesn't appear to pick it up from
> > > > > > > > > src/main/resources/jcache.ccf.
> > > > > > > > >
> > > > > > > >
> > > > > > > > No. If you use one of these cache through jcache then the
> > config
> > > > > should
> > > > > > > get
> > > > > > > > used and the cache be listed. If you start and dont use
jcache
> > -
> > > > even
> > > > > > > using
> > > > > > > > jcs internals - you ll get an empty iterable.
> > > > > > > >
> > > > > > > > > On Fri, Sep 4, 2015 at 1:17 PM, Romain Manni-Bucau <
> > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > Think it does but maybe it takes another one. About
> > > > getCacheNames
> > > > > > it
> > > > > > > is
> > > > > > > > > > only *created* caches ie the one jcache saw and not the
> > ones
> > > > jcs
> > > > > > has.
> > > > > > > > > > Le 4 sept. 2015 19:14, "Steve Goldsmith" <
sgjava@gmail.com
> > >
> > > a
> > > > > > écrit
> > > > > > > :
> > > > > > > > > >
> > > > > > > > > > > Looking at
> > org.apache.commons.jcs.jcache.JCSCachingProvider
> > > > it
> > > > > > > > doesn't
> > > > > > > > > > > appear to search classpath? Do you have to explicitly
> > > specify
> > > > > > path
> > > > > > > in
> > > > > > > > > > > getCacheManager call?
> > > > > > > > > > >
> > > > > > > > > > > On Fri, Sep 4, 2015 at 2:40 AM, Romain Manni-Bucau <
> > > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > > wrote:
> > > > > > > > > > >
> > > > > > > > > > > > Hi,
> > > > > > > > > > > >
> > > > > > > > > > > > final CachingProvider cachingProvider =
> > > > > > > > Caching.getCachingProvider();
> > > > > > > > > > > > final CacheManager cacheManager =
> > > > > > > > cachingProvider.getCacheManager();
> > > > > > > > > > > > cacheManager.createCache("c1", new
> > > > > MutableConfiguration<String,
> > > > > > > > > > > String>());
> > > > > > > > > > > > cacheManager.createCache("c2", new
> > > > > MutableConfiguration<String,
> > > > > > > > > > > String>());
> > > > > > > > > > > > final Collection<String> actualNames = new
> > > > > > ArrayList<String>(2);
> > > > > > > > > > > > for (final String s : cacheManager.getCacheNames())
> > > > > > > > > > > > {
> > > > > > > > > > > >     actualNames.add(s);
> > > > > > > > > > > > }
> > > > > > > > > > > > assertEquals(2, actualNames.size());
> > > > > > > > > > > > assertEquals(new HashSet<String>(asList("c1",
"c2")),
> > new
> > > > > > > > > > > > HashSet<String>(actualNames));
> > > > > > > > > > > > cachingProvider.close();
> > > > > > > > > > > >
> > > > > > > > > > > > works fine so you have a setup issue somewhere - or
you
> > > > dont
> > > > > > use
> > > > > > > > the
> > > > > > > > > > > > same cache manager.
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > 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-04 3:52 GMT+02:00 sgjava <sg...@gmail.com>:
> > > > > > > > > > > >
> > > > > > > > > > > > > getCacheManager().getCacheNames() is not working
with
> > > > JCS.
> > > > > I
> > > > > > > get
> > > > > > > > an
> > > > > > > > > > > empty
> > > > > > > > > > > > > org.apache.commons.jcs.jcache.ImmutableIterable.
The
> > > > > Ehcache
> > > > > > > > provider
> > > > > > > > > > > > > correctly returns a String iterator with the cache
> > > names.
> > > > > My
> > > > > > > > tests
> > > > > > > > > > run
> > > > > > > > > > > > > fine,
> > > > > > > > > > > > > but this is a good way to check that your
> > configuration
> > > > is
> > > > > > > picked
> > > > > > > > up
> > > > > > > > > > > with
> > > > > > > > > > > > > multiple caches defined.
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > --
> > > > > > > > > > > > > View this message in context:
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > > > > > > > > > > > > Sent from the TomEE Users mailing list archive at
> > > > > Nabble.com.
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > Steven P. Goldsmith
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Steven P. Goldsmith
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Steven P. Goldsmith
> > > > >
> > > >
> > >
> >
>
>
>
> --
> Steven P. Goldsmith

Re: commons-jcs-jcach getCacheNames not working

Posted by Steve Goldsmith <sg...@gmail.com>.
I believe the behavior of -all- providers should be the same from a JCache
perspective. I'm not sure why it matters how I create the cache if it's
visible to JCache API getCacheManager().getCache("testCache") then
testCache should show up via getCacheNames. It's not a game changer for me
right now, but what happens when someone relies on the behavior of
getCacheNames?

On Fri, Sep 4, 2015 at 5:40 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:

> Then you suppose it is created if declare which is another not defined
> assumption. Why wouldnt it be lazy?
>
> My point is only you cant rely on what you suppose if you want to stay
> standard and not to say it is good or bad.
> Le 4 sept. 2015 23:09, "Steve Goldsmith" <sg...@gmail.com> a écrit :
>
> > In my mind it should show up even if it's automatically created.
> > On Sep 4, 2015 3:06 PM, "Romain Manni-Bucau" <rm...@gmail.com>
> > wrote:
> >
> > > We can in jcs since we have it but not sure from a API point of view
> what
> > > is better - trying to not use test as an excuse ;)
> > > Le 4 sept. 2015 20:42, "Steve Goldsmith" <sg...@gmail.com> a écrit :
> > >
> > > > Yea, just nice to see the cache show up before you use it in unit
> tests
> > > :)
> > > > Not a biggie from a normal coding perspective.
> > > >
> > > > On Fri, Sep 4, 2015 at 2:32 PM, Romain Manni-Bucau <
> > > rmannibucau@gmail.com>
> > > > wrote:
> > > >
> > > > > Not portable behavior then. But nothing in the standard about the
> > > config
> > > > so
> > > > > looks ok and if your cache is not therz size is empty so nthg
> > blocking
> > > > IMO.
> > > > > Le 4 sept. 2015 20:25, "Steve Goldsmith" <sg...@gmail.com> a
> écrit
> > :
> > > > >
> > > > > > So, you have to explicitly do the createCache? This is different
> > > > behavior
> > > > > > then Ehcache provider. I do not want to code to a provider if
> > > possible.
> > > > > The
> > > > > > weird thing is everything works except getCacheNames, so far :)
> > > > > >
> > > > > > On Fri, Sep 4, 2015 at 1:35 PM, Romain Manni-Bucau <
> > > > > rmannibucau@gmail.com>
> > > > > > wrote:
> > > > > >
> > > > > > > Le 4 sept. 2015 19:30, "Steve Goldsmith" <sg...@gmail.com> a
> > > écrit
> > > > :
> > > > > > > >
> > > > > > > > So if I specify jcache.ccf in classpath, then technically it
> > > should
> > > > > > show
> > > > > > > up
> > > > > > > > via getCacheNames? It doesn't appear to pick it up from
> > > > > > > > src/main/resources/jcache.ccf.
> > > > > > > >
> > > > > > >
> > > > > > > No. If you use one of these cache through jcache then the
> config
> > > > should
> > > > > > get
> > > > > > > used and the cache be listed. If you start and dont use jcache
> -
> > > even
> > > > > > using
> > > > > > > jcs internals - you ll get an empty iterable.
> > > > > > >
> > > > > > > > On Fri, Sep 4, 2015 at 1:17 PM, Romain Manni-Bucau <
> > > > > > > rmannibucau@gmail.com>
> > > > > > > > wrote:
> > > > > > > >
> > > > > > > > > Think it does but maybe it takes another one. About
> > > getCacheNames
> > > > > it
> > > > > > is
> > > > > > > > > only *created* caches ie the one jcache saw and not the
> ones
> > > jcs
> > > > > has.
> > > > > > > > > Le 4 sept. 2015 19:14, "Steve Goldsmith" <sgjava@gmail.com
> >
> > a
> > > > > écrit
> > > > > > :
> > > > > > > > >
> > > > > > > > > > Looking at
> org.apache.commons.jcs.jcache.JCSCachingProvider
> > > it
> > > > > > > doesn't
> > > > > > > > > > appear to search classpath? Do you have to explicitly
> > specify
> > > > > path
> > > > > > in
> > > > > > > > > > getCacheManager call?
> > > > > > > > > >
> > > > > > > > > > On Fri, Sep 4, 2015 at 2:40 AM, Romain Manni-Bucau <
> > > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > > wrote:
> > > > > > > > > >
> > > > > > > > > > > Hi,
> > > > > > > > > > >
> > > > > > > > > > > final CachingProvider cachingProvider =
> > > > > > > Caching.getCachingProvider();
> > > > > > > > > > > final CacheManager cacheManager =
> > > > > > > cachingProvider.getCacheManager();
> > > > > > > > > > > cacheManager.createCache("c1", new
> > > > MutableConfiguration<String,
> > > > > > > > > > String>());
> > > > > > > > > > > cacheManager.createCache("c2", new
> > > > MutableConfiguration<String,
> > > > > > > > > > String>());
> > > > > > > > > > > final Collection<String> actualNames = new
> > > > > ArrayList<String>(2);
> > > > > > > > > > > for (final String s : cacheManager.getCacheNames())
> > > > > > > > > > > {
> > > > > > > > > > >     actualNames.add(s);
> > > > > > > > > > > }
> > > > > > > > > > > assertEquals(2, actualNames.size());
> > > > > > > > > > > assertEquals(new HashSet<String>(asList("c1", "c2")),
> new
> > > > > > > > > > > HashSet<String>(actualNames));
> > > > > > > > > > > cachingProvider.close();
> > > > > > > > > > >
> > > > > > > > > > > works fine so you have a setup issue somewhere - or you
> > > dont
> > > > > use
> > > > > > > the
> > > > > > > > > > > same cache manager.
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > 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-04 3:52 GMT+02:00 sgjava <sg...@gmail.com>:
> > > > > > > > > > >
> > > > > > > > > > > > getCacheManager().getCacheNames() is not working with
> > > JCS.
> > > > I
> > > > > > get
> > > > > > > an
> > > > > > > > > > empty
> > > > > > > > > > > > org.apache.commons.jcs.jcache.ImmutableIterable. The
> > > > Ehcache
> > > > > > > provider
> > > > > > > > > > > > correctly returns a String iterator with the cache
> > names.
> > > > My
> > > > > > > tests
> > > > > > > > > run
> > > > > > > > > > > > fine,
> > > > > > > > > > > > but this is a good way to check that your
> configuration
> > > is
> > > > > > picked
> > > > > > > up
> > > > > > > > > > with
> > > > > > > > > > > > multiple caches defined.
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > --
> > > > > > > > > > > > View this message in context:
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > > > > > > > > > > > Sent from the TomEE Users mailing list archive at
> > > > Nabble.com.
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > Steven P. Goldsmith
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > Steven P. Goldsmith
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Steven P. Goldsmith
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Steven P. Goldsmith
> > > >
> > >
> >
>



-- 
Steven P. Goldsmith

Re: commons-jcs-jcach getCacheNames not working

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Then you suppose it is created if declare which is another not defined
assumption. Why wouldnt it be lazy?

My point is only you cant rely on what you suppose if you want to stay
standard and not to say it is good or bad.
Le 4 sept. 2015 23:09, "Steve Goldsmith" <sg...@gmail.com> a écrit :

> In my mind it should show up even if it's automatically created.
> On Sep 4, 2015 3:06 PM, "Romain Manni-Bucau" <rm...@gmail.com>
> wrote:
>
> > We can in jcs since we have it but not sure from a API point of view what
> > is better - trying to not use test as an excuse ;)
> > Le 4 sept. 2015 20:42, "Steve Goldsmith" <sg...@gmail.com> a écrit :
> >
> > > Yea, just nice to see the cache show up before you use it in unit tests
> > :)
> > > Not a biggie from a normal coding perspective.
> > >
> > > On Fri, Sep 4, 2015 at 2:32 PM, Romain Manni-Bucau <
> > rmannibucau@gmail.com>
> > > wrote:
> > >
> > > > Not portable behavior then. But nothing in the standard about the
> > config
> > > so
> > > > looks ok and if your cache is not therz size is empty so nthg
> blocking
> > > IMO.
> > > > Le 4 sept. 2015 20:25, "Steve Goldsmith" <sg...@gmail.com> a écrit
> :
> > > >
> > > > > So, you have to explicitly do the createCache? This is different
> > > behavior
> > > > > then Ehcache provider. I do not want to code to a provider if
> > possible.
> > > > The
> > > > > weird thing is everything works except getCacheNames, so far :)
> > > > >
> > > > > On Fri, Sep 4, 2015 at 1:35 PM, Romain Manni-Bucau <
> > > > rmannibucau@gmail.com>
> > > > > wrote:
> > > > >
> > > > > > Le 4 sept. 2015 19:30, "Steve Goldsmith" <sg...@gmail.com> a
> > écrit
> > > :
> > > > > > >
> > > > > > > So if I specify jcache.ccf in classpath, then technically it
> > should
> > > > > show
> > > > > > up
> > > > > > > via getCacheNames? It doesn't appear to pick it up from
> > > > > > > src/main/resources/jcache.ccf.
> > > > > > >
> > > > > >
> > > > > > No. If you use one of these cache through jcache then the config
> > > should
> > > > > get
> > > > > > used and the cache be listed. If you start and dont use jcache -
> > even
> > > > > using
> > > > > > jcs internals - you ll get an empty iterable.
> > > > > >
> > > > > > > On Fri, Sep 4, 2015 at 1:17 PM, Romain Manni-Bucau <
> > > > > > rmannibucau@gmail.com>
> > > > > > > wrote:
> > > > > > >
> > > > > > > > Think it does but maybe it takes another one. About
> > getCacheNames
> > > > it
> > > > > is
> > > > > > > > only *created* caches ie the one jcache saw and not the ones
> > jcs
> > > > has.
> > > > > > > > Le 4 sept. 2015 19:14, "Steve Goldsmith" <sg...@gmail.com>
> a
> > > > écrit
> > > > > :
> > > > > > > >
> > > > > > > > > Looking at org.apache.commons.jcs.jcache.JCSCachingProvider
> > it
> > > > > > doesn't
> > > > > > > > > appear to search classpath? Do you have to explicitly
> specify
> > > > path
> > > > > in
> > > > > > > > > getCacheManager call?
> > > > > > > > >
> > > > > > > > > On Fri, Sep 4, 2015 at 2:40 AM, Romain Manni-Bucau <
> > > > > > > > rmannibucau@gmail.com>
> > > > > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > Hi,
> > > > > > > > > >
> > > > > > > > > > final CachingProvider cachingProvider =
> > > > > > Caching.getCachingProvider();
> > > > > > > > > > final CacheManager cacheManager =
> > > > > > cachingProvider.getCacheManager();
> > > > > > > > > > cacheManager.createCache("c1", new
> > > MutableConfiguration<String,
> > > > > > > > > String>());
> > > > > > > > > > cacheManager.createCache("c2", new
> > > MutableConfiguration<String,
> > > > > > > > > String>());
> > > > > > > > > > final Collection<String> actualNames = new
> > > > ArrayList<String>(2);
> > > > > > > > > > for (final String s : cacheManager.getCacheNames())
> > > > > > > > > > {
> > > > > > > > > >     actualNames.add(s);
> > > > > > > > > > }
> > > > > > > > > > assertEquals(2, actualNames.size());
> > > > > > > > > > assertEquals(new HashSet<String>(asList("c1", "c2")), new
> > > > > > > > > > HashSet<String>(actualNames));
> > > > > > > > > > cachingProvider.close();
> > > > > > > > > >
> > > > > > > > > > works fine so you have a setup issue somewhere - or you
> > dont
> > > > use
> > > > > > the
> > > > > > > > > > same cache manager.
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > 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-04 3:52 GMT+02:00 sgjava <sg...@gmail.com>:
> > > > > > > > > >
> > > > > > > > > > > getCacheManager().getCacheNames() is not working with
> > JCS.
> > > I
> > > > > get
> > > > > > an
> > > > > > > > > empty
> > > > > > > > > > > org.apache.commons.jcs.jcache.ImmutableIterable. The
> > > Ehcache
> > > > > > provider
> > > > > > > > > > > correctly returns a String iterator with the cache
> names.
> > > My
> > > > > > tests
> > > > > > > > run
> > > > > > > > > > > fine,
> > > > > > > > > > > but this is a good way to check that your configuration
> > is
> > > > > picked
> > > > > > up
> > > > > > > > > with
> > > > > > > > > > > multiple caches defined.
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > View this message in context:
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > > > > > > > > > > Sent from the TomEE Users mailing list archive at
> > > Nabble.com.
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > Steven P. Goldsmith
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Steven P. Goldsmith
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Steven P. Goldsmith
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Steven P. Goldsmith
> > >
> >
>

Re: commons-jcs-jcach getCacheNames not working

Posted by Steve Goldsmith <sg...@gmail.com>.
In my mind it should show up even if it's automatically created.
On Sep 4, 2015 3:06 PM, "Romain Manni-Bucau" <rm...@gmail.com> wrote:

> We can in jcs since we have it but not sure from a API point of view what
> is better - trying to not use test as an excuse ;)
> Le 4 sept. 2015 20:42, "Steve Goldsmith" <sg...@gmail.com> a écrit :
>
> > Yea, just nice to see the cache show up before you use it in unit tests
> :)
> > Not a biggie from a normal coding perspective.
> >
> > On Fri, Sep 4, 2015 at 2:32 PM, Romain Manni-Bucau <
> rmannibucau@gmail.com>
> > wrote:
> >
> > > Not portable behavior then. But nothing in the standard about the
> config
> > so
> > > looks ok and if your cache is not therz size is empty so nthg blocking
> > IMO.
> > > Le 4 sept. 2015 20:25, "Steve Goldsmith" <sg...@gmail.com> a écrit :
> > >
> > > > So, you have to explicitly do the createCache? This is different
> > behavior
> > > > then Ehcache provider. I do not want to code to a provider if
> possible.
> > > The
> > > > weird thing is everything works except getCacheNames, so far :)
> > > >
> > > > On Fri, Sep 4, 2015 at 1:35 PM, Romain Manni-Bucau <
> > > rmannibucau@gmail.com>
> > > > wrote:
> > > >
> > > > > Le 4 sept. 2015 19:30, "Steve Goldsmith" <sg...@gmail.com> a
> écrit
> > :
> > > > > >
> > > > > > So if I specify jcache.ccf in classpath, then technically it
> should
> > > > show
> > > > > up
> > > > > > via getCacheNames? It doesn't appear to pick it up from
> > > > > > src/main/resources/jcache.ccf.
> > > > > >
> > > > >
> > > > > No. If you use one of these cache through jcache then the config
> > should
> > > > get
> > > > > used and the cache be listed. If you start and dont use jcache -
> even
> > > > using
> > > > > jcs internals - you ll get an empty iterable.
> > > > >
> > > > > > On Fri, Sep 4, 2015 at 1:17 PM, Romain Manni-Bucau <
> > > > > rmannibucau@gmail.com>
> > > > > > wrote:
> > > > > >
> > > > > > > Think it does but maybe it takes another one. About
> getCacheNames
> > > it
> > > > is
> > > > > > > only *created* caches ie the one jcache saw and not the ones
> jcs
> > > has.
> > > > > > > Le 4 sept. 2015 19:14, "Steve Goldsmith" <sg...@gmail.com> a
> > > écrit
> > > > :
> > > > > > >
> > > > > > > > Looking at org.apache.commons.jcs.jcache.JCSCachingProvider
> it
> > > > > doesn't
> > > > > > > > appear to search classpath? Do you have to explicitly specify
> > > path
> > > > in
> > > > > > > > getCacheManager call?
> > > > > > > >
> > > > > > > > On Fri, Sep 4, 2015 at 2:40 AM, Romain Manni-Bucau <
> > > > > > > rmannibucau@gmail.com>
> > > > > > > > wrote:
> > > > > > > >
> > > > > > > > > Hi,
> > > > > > > > >
> > > > > > > > > final CachingProvider cachingProvider =
> > > > > Caching.getCachingProvider();
> > > > > > > > > final CacheManager cacheManager =
> > > > > cachingProvider.getCacheManager();
> > > > > > > > > cacheManager.createCache("c1", new
> > MutableConfiguration<String,
> > > > > > > > String>());
> > > > > > > > > cacheManager.createCache("c2", new
> > MutableConfiguration<String,
> > > > > > > > String>());
> > > > > > > > > final Collection<String> actualNames = new
> > > ArrayList<String>(2);
> > > > > > > > > for (final String s : cacheManager.getCacheNames())
> > > > > > > > > {
> > > > > > > > >     actualNames.add(s);
> > > > > > > > > }
> > > > > > > > > assertEquals(2, actualNames.size());
> > > > > > > > > assertEquals(new HashSet<String>(asList("c1", "c2")), new
> > > > > > > > > HashSet<String>(actualNames));
> > > > > > > > > cachingProvider.close();
> > > > > > > > >
> > > > > > > > > works fine so you have a setup issue somewhere - or you
> dont
> > > use
> > > > > the
> > > > > > > > > same cache manager.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > 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-04 3:52 GMT+02:00 sgjava <sg...@gmail.com>:
> > > > > > > > >
> > > > > > > > > > getCacheManager().getCacheNames() is not working with
> JCS.
> > I
> > > > get
> > > > > an
> > > > > > > > empty
> > > > > > > > > > org.apache.commons.jcs.jcache.ImmutableIterable. The
> > Ehcache
> > > > > provider
> > > > > > > > > > correctly returns a String iterator with the cache names.
> > My
> > > > > tests
> > > > > > > run
> > > > > > > > > > fine,
> > > > > > > > > > but this is a good way to check that your configuration
> is
> > > > picked
> > > > > up
> > > > > > > > with
> > > > > > > > > > multiple caches defined.
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > View this message in context:
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > >
> > > > >
> > > >
> > >
> >
> http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > > > > > > > > > Sent from the TomEE Users mailing list archive at
> > Nabble.com.
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > Steven P. Goldsmith
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Steven P. Goldsmith
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Steven P. Goldsmith
> > > >
> > >
> >
> >
> >
> > --
> > Steven P. Goldsmith
> >
>

Re: commons-jcs-jcach getCacheNames not working

Posted by Romain Manni-Bucau <rm...@gmail.com>.
We can in jcs since we have it but not sure from a API point of view what
is better - trying to not use test as an excuse ;)
Le 4 sept. 2015 20:42, "Steve Goldsmith" <sg...@gmail.com> a écrit :

> Yea, just nice to see the cache show up before you use it in unit tests :)
> Not a biggie from a normal coding perspective.
>
> On Fri, Sep 4, 2015 at 2:32 PM, Romain Manni-Bucau <rm...@gmail.com>
> wrote:
>
> > Not portable behavior then. But nothing in the standard about the config
> so
> > looks ok and if your cache is not therz size is empty so nthg blocking
> IMO.
> > Le 4 sept. 2015 20:25, "Steve Goldsmith" <sg...@gmail.com> a écrit :
> >
> > > So, you have to explicitly do the createCache? This is different
> behavior
> > > then Ehcache provider. I do not want to code to a provider if possible.
> > The
> > > weird thing is everything works except getCacheNames, so far :)
> > >
> > > On Fri, Sep 4, 2015 at 1:35 PM, Romain Manni-Bucau <
> > rmannibucau@gmail.com>
> > > wrote:
> > >
> > > > Le 4 sept. 2015 19:30, "Steve Goldsmith" <sg...@gmail.com> a écrit
> :
> > > > >
> > > > > So if I specify jcache.ccf in classpath, then technically it should
> > > show
> > > > up
> > > > > via getCacheNames? It doesn't appear to pick it up from
> > > > > src/main/resources/jcache.ccf.
> > > > >
> > > >
> > > > No. If you use one of these cache through jcache then the config
> should
> > > get
> > > > used and the cache be listed. If you start and dont use jcache - even
> > > using
> > > > jcs internals - you ll get an empty iterable.
> > > >
> > > > > On Fri, Sep 4, 2015 at 1:17 PM, Romain Manni-Bucau <
> > > > rmannibucau@gmail.com>
> > > > > wrote:
> > > > >
> > > > > > Think it does but maybe it takes another one. About getCacheNames
> > it
> > > is
> > > > > > only *created* caches ie the one jcache saw and not the ones jcs
> > has.
> > > > > > Le 4 sept. 2015 19:14, "Steve Goldsmith" <sg...@gmail.com> a
> > écrit
> > > :
> > > > > >
> > > > > > > Looking at org.apache.commons.jcs.jcache.JCSCachingProvider it
> > > > doesn't
> > > > > > > appear to search classpath? Do you have to explicitly specify
> > path
> > > in
> > > > > > > getCacheManager call?
> > > > > > >
> > > > > > > On Fri, Sep 4, 2015 at 2:40 AM, Romain Manni-Bucau <
> > > > > > rmannibucau@gmail.com>
> > > > > > > wrote:
> > > > > > >
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > final CachingProvider cachingProvider =
> > > > Caching.getCachingProvider();
> > > > > > > > final CacheManager cacheManager =
> > > > cachingProvider.getCacheManager();
> > > > > > > > cacheManager.createCache("c1", new
> MutableConfiguration<String,
> > > > > > > String>());
> > > > > > > > cacheManager.createCache("c2", new
> MutableConfiguration<String,
> > > > > > > String>());
> > > > > > > > final Collection<String> actualNames = new
> > ArrayList<String>(2);
> > > > > > > > for (final String s : cacheManager.getCacheNames())
> > > > > > > > {
> > > > > > > >     actualNames.add(s);
> > > > > > > > }
> > > > > > > > assertEquals(2, actualNames.size());
> > > > > > > > assertEquals(new HashSet<String>(asList("c1", "c2")), new
> > > > > > > > HashSet<String>(actualNames));
> > > > > > > > cachingProvider.close();
> > > > > > > >
> > > > > > > > works fine so you have a setup issue somewhere - or you dont
> > use
> > > > the
> > > > > > > > same cache manager.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > 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-04 3:52 GMT+02:00 sgjava <sg...@gmail.com>:
> > > > > > > >
> > > > > > > > > getCacheManager().getCacheNames() is not working with JCS.
> I
> > > get
> > > > an
> > > > > > > empty
> > > > > > > > > org.apache.commons.jcs.jcache.ImmutableIterable. The
> Ehcache
> > > > provider
> > > > > > > > > correctly returns a String iterator with the cache names.
> My
> > > > tests
> > > > > > run
> > > > > > > > > fine,
> > > > > > > > > but this is a good way to check that your configuration is
> > > picked
> > > > up
> > > > > > > with
> > > > > > > > > multiple caches defined.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > View this message in context:
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > >
> > > >
> > >
> >
> http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > > > > > > > > Sent from the TomEE Users mailing list archive at
> Nabble.com.
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Steven P. Goldsmith
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Steven P. Goldsmith
> > > >
> > >
> > >
> > >
> > > --
> > > Steven P. Goldsmith
> > >
> >
>
>
>
> --
> Steven P. Goldsmith
>

Re: commons-jcs-jcach getCacheNames not working

Posted by Steve Goldsmith <sg...@gmail.com>.
Yea, just nice to see the cache show up before you use it in unit tests :)
Not a biggie from a normal coding perspective.

On Fri, Sep 4, 2015 at 2:32 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:

> Not portable behavior then. But nothing in the standard about the config so
> looks ok and if your cache is not therz size is empty so nthg blocking IMO.
> Le 4 sept. 2015 20:25, "Steve Goldsmith" <sg...@gmail.com> a écrit :
>
> > So, you have to explicitly do the createCache? This is different behavior
> > then Ehcache provider. I do not want to code to a provider if possible.
> The
> > weird thing is everything works except getCacheNames, so far :)
> >
> > On Fri, Sep 4, 2015 at 1:35 PM, Romain Manni-Bucau <
> rmannibucau@gmail.com>
> > wrote:
> >
> > > Le 4 sept. 2015 19:30, "Steve Goldsmith" <sg...@gmail.com> a écrit :
> > > >
> > > > So if I specify jcache.ccf in classpath, then technically it should
> > show
> > > up
> > > > via getCacheNames? It doesn't appear to pick it up from
> > > > src/main/resources/jcache.ccf.
> > > >
> > >
> > > No. If you use one of these cache through jcache then the config should
> > get
> > > used and the cache be listed. If you start and dont use jcache - even
> > using
> > > jcs internals - you ll get an empty iterable.
> > >
> > > > On Fri, Sep 4, 2015 at 1:17 PM, Romain Manni-Bucau <
> > > rmannibucau@gmail.com>
> > > > wrote:
> > > >
> > > > > Think it does but maybe it takes another one. About getCacheNames
> it
> > is
> > > > > only *created* caches ie the one jcache saw and not the ones jcs
> has.
> > > > > Le 4 sept. 2015 19:14, "Steve Goldsmith" <sg...@gmail.com> a
> écrit
> > :
> > > > >
> > > > > > Looking at org.apache.commons.jcs.jcache.JCSCachingProvider it
> > > doesn't
> > > > > > appear to search classpath? Do you have to explicitly specify
> path
> > in
> > > > > > getCacheManager call?
> > > > > >
> > > > > > On Fri, Sep 4, 2015 at 2:40 AM, Romain Manni-Bucau <
> > > > > rmannibucau@gmail.com>
> > > > > > wrote:
> > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > final CachingProvider cachingProvider =
> > > Caching.getCachingProvider();
> > > > > > > final CacheManager cacheManager =
> > > cachingProvider.getCacheManager();
> > > > > > > cacheManager.createCache("c1", new MutableConfiguration<String,
> > > > > > String>());
> > > > > > > cacheManager.createCache("c2", new MutableConfiguration<String,
> > > > > > String>());
> > > > > > > final Collection<String> actualNames = new
> ArrayList<String>(2);
> > > > > > > for (final String s : cacheManager.getCacheNames())
> > > > > > > {
> > > > > > >     actualNames.add(s);
> > > > > > > }
> > > > > > > assertEquals(2, actualNames.size());
> > > > > > > assertEquals(new HashSet<String>(asList("c1", "c2")), new
> > > > > > > HashSet<String>(actualNames));
> > > > > > > cachingProvider.close();
> > > > > > >
> > > > > > > works fine so you have a setup issue somewhere - or you dont
> use
> > > the
> > > > > > > same cache manager.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > 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-04 3:52 GMT+02:00 sgjava <sg...@gmail.com>:
> > > > > > >
> > > > > > > > getCacheManager().getCacheNames() is not working with JCS. I
> > get
> > > an
> > > > > > empty
> > > > > > > > org.apache.commons.jcs.jcache.ImmutableIterable. The Ehcache
> > > provider
> > > > > > > > correctly returns a String iterator with the cache names. My
> > > tests
> > > > > run
> > > > > > > > fine,
> > > > > > > > but this is a good way to check that your configuration is
> > picked
> > > up
> > > > > > with
> > > > > > > > multiple caches defined.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > View this message in context:
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > >
> > >
> >
> http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > > > > > > > Sent from the TomEE Users mailing list archive at Nabble.com.
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Steven P. Goldsmith
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Steven P. Goldsmith
> > >
> >
> >
> >
> > --
> > Steven P. Goldsmith
> >
>



-- 
Steven P. Goldsmith

Re: commons-jcs-jcach getCacheNames not working

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Not portable behavior then. But nothing in the standard about the config so
looks ok and if your cache is not therz size is empty so nthg blocking IMO.
Le 4 sept. 2015 20:25, "Steve Goldsmith" <sg...@gmail.com> a écrit :

> So, you have to explicitly do the createCache? This is different behavior
> then Ehcache provider. I do not want to code to a provider if possible. The
> weird thing is everything works except getCacheNames, so far :)
>
> On Fri, Sep 4, 2015 at 1:35 PM, Romain Manni-Bucau <rm...@gmail.com>
> wrote:
>
> > Le 4 sept. 2015 19:30, "Steve Goldsmith" <sg...@gmail.com> a écrit :
> > >
> > > So if I specify jcache.ccf in classpath, then technically it should
> show
> > up
> > > via getCacheNames? It doesn't appear to pick it up from
> > > src/main/resources/jcache.ccf.
> > >
> >
> > No. If you use one of these cache through jcache then the config should
> get
> > used and the cache be listed. If you start and dont use jcache - even
> using
> > jcs internals - you ll get an empty iterable.
> >
> > > On Fri, Sep 4, 2015 at 1:17 PM, Romain Manni-Bucau <
> > rmannibucau@gmail.com>
> > > wrote:
> > >
> > > > Think it does but maybe it takes another one. About getCacheNames it
> is
> > > > only *created* caches ie the one jcache saw and not the ones jcs has.
> > > > Le 4 sept. 2015 19:14, "Steve Goldsmith" <sg...@gmail.com> a écrit
> :
> > > >
> > > > > Looking at org.apache.commons.jcs.jcache.JCSCachingProvider it
> > doesn't
> > > > > appear to search classpath? Do you have to explicitly specify path
> in
> > > > > getCacheManager call?
> > > > >
> > > > > On Fri, Sep 4, 2015 at 2:40 AM, Romain Manni-Bucau <
> > > > rmannibucau@gmail.com>
> > > > > wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > final CachingProvider cachingProvider =
> > Caching.getCachingProvider();
> > > > > > final CacheManager cacheManager =
> > cachingProvider.getCacheManager();
> > > > > > cacheManager.createCache("c1", new MutableConfiguration<String,
> > > > > String>());
> > > > > > cacheManager.createCache("c2", new MutableConfiguration<String,
> > > > > String>());
> > > > > > final Collection<String> actualNames = new ArrayList<String>(2);
> > > > > > for (final String s : cacheManager.getCacheNames())
> > > > > > {
> > > > > >     actualNames.add(s);
> > > > > > }
> > > > > > assertEquals(2, actualNames.size());
> > > > > > assertEquals(new HashSet<String>(asList("c1", "c2")), new
> > > > > > HashSet<String>(actualNames));
> > > > > > cachingProvider.close();
> > > > > >
> > > > > > works fine so you have a setup issue somewhere - or you dont use
> > the
> > > > > > same cache manager.
> > > > > >
> > > > > >
> > > > > >
> > > > > > 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-04 3:52 GMT+02:00 sgjava <sg...@gmail.com>:
> > > > > >
> > > > > > > getCacheManager().getCacheNames() is not working with JCS. I
> get
> > an
> > > > > empty
> > > > > > > org.apache.commons.jcs.jcache.ImmutableIterable. The Ehcache
> > provider
> > > > > > > correctly returns a String iterator with the cache names. My
> > tests
> > > > run
> > > > > > > fine,
> > > > > > > but this is a good way to check that your configuration is
> picked
> > up
> > > > > with
> > > > > > > multiple caches defined.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > View this message in context:
> > > > > > >
> > > > > >
> > > > >
> > > >
> >
> >
> http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > > > > > > Sent from the TomEE Users mailing list archive at Nabble.com.
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Steven P. Goldsmith
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Steven P. Goldsmith
> >
>
>
>
> --
> Steven P. Goldsmith
>

Re: commons-jcs-jcach getCacheNames not working

Posted by Steve Goldsmith <sg...@gmail.com>.
So, you have to explicitly do the createCache? This is different behavior
then Ehcache provider. I do not want to code to a provider if possible. The
weird thing is everything works except getCacheNames, so far :)

On Fri, Sep 4, 2015 at 1:35 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:

> Le 4 sept. 2015 19:30, "Steve Goldsmith" <sg...@gmail.com> a écrit :
> >
> > So if I specify jcache.ccf in classpath, then technically it should show
> up
> > via getCacheNames? It doesn't appear to pick it up from
> > src/main/resources/jcache.ccf.
> >
>
> No. If you use one of these cache through jcache then the config should get
> used and the cache be listed. If you start and dont use jcache - even using
> jcs internals - you ll get an empty iterable.
>
> > On Fri, Sep 4, 2015 at 1:17 PM, Romain Manni-Bucau <
> rmannibucau@gmail.com>
> > wrote:
> >
> > > Think it does but maybe it takes another one. About getCacheNames it is
> > > only *created* caches ie the one jcache saw and not the ones jcs has.
> > > Le 4 sept. 2015 19:14, "Steve Goldsmith" <sg...@gmail.com> a écrit :
> > >
> > > > Looking at org.apache.commons.jcs.jcache.JCSCachingProvider it
> doesn't
> > > > appear to search classpath? Do you have to explicitly specify path in
> > > > getCacheManager call?
> > > >
> > > > On Fri, Sep 4, 2015 at 2:40 AM, Romain Manni-Bucau <
> > > rmannibucau@gmail.com>
> > > > wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > final CachingProvider cachingProvider =
> Caching.getCachingProvider();
> > > > > final CacheManager cacheManager =
> cachingProvider.getCacheManager();
> > > > > cacheManager.createCache("c1", new MutableConfiguration<String,
> > > > String>());
> > > > > cacheManager.createCache("c2", new MutableConfiguration<String,
> > > > String>());
> > > > > final Collection<String> actualNames = new ArrayList<String>(2);
> > > > > for (final String s : cacheManager.getCacheNames())
> > > > > {
> > > > >     actualNames.add(s);
> > > > > }
> > > > > assertEquals(2, actualNames.size());
> > > > > assertEquals(new HashSet<String>(asList("c1", "c2")), new
> > > > > HashSet<String>(actualNames));
> > > > > cachingProvider.close();
> > > > >
> > > > > works fine so you have a setup issue somewhere - or you dont use
> the
> > > > > same cache manager.
> > > > >
> > > > >
> > > > >
> > > > > 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-04 3:52 GMT+02:00 sgjava <sg...@gmail.com>:
> > > > >
> > > > > > getCacheManager().getCacheNames() is not working with JCS. I get
> an
> > > > empty
> > > > > > org.apache.commons.jcs.jcache.ImmutableIterable. The Ehcache
> provider
> > > > > > correctly returns a String iterator with the cache names. My
> tests
> > > run
> > > > > > fine,
> > > > > > but this is a good way to check that your configuration is picked
> up
> > > > with
> > > > > > multiple caches defined.
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > View this message in context:
> > > > > >
> > > > >
> > > >
> > >
>
> http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > > > > > Sent from the TomEE Users mailing list archive at Nabble.com.
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Steven P. Goldsmith
> > > >
> > >
> >
> >
> >
> > --
> > Steven P. Goldsmith
>



-- 
Steven P. Goldsmith

Re: commons-jcs-jcach getCacheNames not working

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Le 4 sept. 2015 19:30, "Steve Goldsmith" <sg...@gmail.com> a écrit :
>
> So if I specify jcache.ccf in classpath, then technically it should show
up
> via getCacheNames? It doesn't appear to pick it up from
> src/main/resources/jcache.ccf.
>

No. If you use one of these cache through jcache then the config should get
used and the cache be listed. If you start and dont use jcache - even using
jcs internals - you ll get an empty iterable.

> On Fri, Sep 4, 2015 at 1:17 PM, Romain Manni-Bucau <rm...@gmail.com>
> wrote:
>
> > Think it does but maybe it takes another one. About getCacheNames it is
> > only *created* caches ie the one jcache saw and not the ones jcs has.
> > Le 4 sept. 2015 19:14, "Steve Goldsmith" <sg...@gmail.com> a écrit :
> >
> > > Looking at org.apache.commons.jcs.jcache.JCSCachingProvider it doesn't
> > > appear to search classpath? Do you have to explicitly specify path in
> > > getCacheManager call?
> > >
> > > On Fri, Sep 4, 2015 at 2:40 AM, Romain Manni-Bucau <
> > rmannibucau@gmail.com>
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > final CachingProvider cachingProvider =
Caching.getCachingProvider();
> > > > final CacheManager cacheManager = cachingProvider.getCacheManager();
> > > > cacheManager.createCache("c1", new MutableConfiguration<String,
> > > String>());
> > > > cacheManager.createCache("c2", new MutableConfiguration<String,
> > > String>());
> > > > final Collection<String> actualNames = new ArrayList<String>(2);
> > > > for (final String s : cacheManager.getCacheNames())
> > > > {
> > > >     actualNames.add(s);
> > > > }
> > > > assertEquals(2, actualNames.size());
> > > > assertEquals(new HashSet<String>(asList("c1", "c2")), new
> > > > HashSet<String>(actualNames));
> > > > cachingProvider.close();
> > > >
> > > > works fine so you have a setup issue somewhere - or you dont use the
> > > > same cache manager.
> > > >
> > > >
> > > >
> > > > 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-04 3:52 GMT+02:00 sgjava <sg...@gmail.com>:
> > > >
> > > > > getCacheManager().getCacheNames() is not working with JCS. I get
an
> > > empty
> > > > > org.apache.commons.jcs.jcache.ImmutableIterable. The Ehcache
provider
> > > > > correctly returns a String iterator with the cache names. My tests
> > run
> > > > > fine,
> > > > > but this is a good way to check that your configuration is picked
up
> > > with
> > > > > multiple caches defined.
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > View this message in context:
> > > > >
> > > >
> > >
> >
http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > > > > Sent from the TomEE Users mailing list archive at Nabble.com.
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Steven P. Goldsmith
> > >
> >
>
>
>
> --
> Steven P. Goldsmith

Re: commons-jcs-jcach getCacheNames not working

Posted by Steve Goldsmith <sg...@gmail.com>.
So if I specify jcache.ccf in classpath, then technically it should show up
via getCacheNames? It doesn't appear to pick it up from
src/main/resources/jcache.ccf.

On Fri, Sep 4, 2015 at 1:17 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:

> Think it does but maybe it takes another one. About getCacheNames it is
> only *created* caches ie the one jcache saw and not the ones jcs has.
> Le 4 sept. 2015 19:14, "Steve Goldsmith" <sg...@gmail.com> a écrit :
>
> > Looking at org.apache.commons.jcs.jcache.JCSCachingProvider it doesn't
> > appear to search classpath? Do you have to explicitly specify path in
> > getCacheManager call?
> >
> > On Fri, Sep 4, 2015 at 2:40 AM, Romain Manni-Bucau <
> rmannibucau@gmail.com>
> > wrote:
> >
> > > Hi,
> > >
> > > final CachingProvider cachingProvider = Caching.getCachingProvider();
> > > final CacheManager cacheManager = cachingProvider.getCacheManager();
> > > cacheManager.createCache("c1", new MutableConfiguration<String,
> > String>());
> > > cacheManager.createCache("c2", new MutableConfiguration<String,
> > String>());
> > > final Collection<String> actualNames = new ArrayList<String>(2);
> > > for (final String s : cacheManager.getCacheNames())
> > > {
> > >     actualNames.add(s);
> > > }
> > > assertEquals(2, actualNames.size());
> > > assertEquals(new HashSet<String>(asList("c1", "c2")), new
> > > HashSet<String>(actualNames));
> > > cachingProvider.close();
> > >
> > > works fine so you have a setup issue somewhere - or you dont use the
> > > same cache manager.
> > >
> > >
> > >
> > > 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-04 3:52 GMT+02:00 sgjava <sg...@gmail.com>:
> > >
> > > > getCacheManager().getCacheNames() is not working with JCS. I get an
> > empty
> > > > org.apache.commons.jcs.jcache.ImmutableIterable. The Ehcache provider
> > > > correctly returns a String iterator with the cache names. My tests
> run
> > > > fine,
> > > > but this is a good way to check that your configuration is picked up
> > with
> > > > multiple caches defined.
> > > >
> > > >
> > > >
> > > > --
> > > > View this message in context:
> > > >
> > >
> >
> http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > > > Sent from the TomEE Users mailing list archive at Nabble.com.
> > > >
> > >
> >
> >
> >
> > --
> > Steven P. Goldsmith
> >
>



-- 
Steven P. Goldsmith

Re: commons-jcs-jcach getCacheNames not working

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Think it does but maybe it takes another one. About getCacheNames it is
only *created* caches ie the one jcache saw and not the ones jcs has.
Le 4 sept. 2015 19:14, "Steve Goldsmith" <sg...@gmail.com> a écrit :

> Looking at org.apache.commons.jcs.jcache.JCSCachingProvider it doesn't
> appear to search classpath? Do you have to explicitly specify path in
> getCacheManager call?
>
> On Fri, Sep 4, 2015 at 2:40 AM, Romain Manni-Bucau <rm...@gmail.com>
> wrote:
>
> > Hi,
> >
> > final CachingProvider cachingProvider = Caching.getCachingProvider();
> > final CacheManager cacheManager = cachingProvider.getCacheManager();
> > cacheManager.createCache("c1", new MutableConfiguration<String,
> String>());
> > cacheManager.createCache("c2", new MutableConfiguration<String,
> String>());
> > final Collection<String> actualNames = new ArrayList<String>(2);
> > for (final String s : cacheManager.getCacheNames())
> > {
> >     actualNames.add(s);
> > }
> > assertEquals(2, actualNames.size());
> > assertEquals(new HashSet<String>(asList("c1", "c2")), new
> > HashSet<String>(actualNames));
> > cachingProvider.close();
> >
> > works fine so you have a setup issue somewhere - or you dont use the
> > same cache manager.
> >
> >
> >
> > 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-04 3:52 GMT+02:00 sgjava <sg...@gmail.com>:
> >
> > > getCacheManager().getCacheNames() is not working with JCS. I get an
> empty
> > > org.apache.commons.jcs.jcache.ImmutableIterable. The Ehcache provider
> > > correctly returns a String iterator with the cache names. My tests run
> > > fine,
> > > but this is a good way to check that your configuration is picked up
> with
> > > multiple caches defined.
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > > Sent from the TomEE Users mailing list archive at Nabble.com.
> > >
> >
>
>
>
> --
> Steven P. Goldsmith
>

Re: commons-jcs-jcach getCacheNames not working

Posted by Steve Goldsmith <sg...@gmail.com>.
Looking at org.apache.commons.jcs.jcache.JCSCachingProvider it doesn't
appear to search classpath? Do you have to explicitly specify path in
getCacheManager call?

On Fri, Sep 4, 2015 at 2:40 AM, Romain Manni-Bucau <rm...@gmail.com>
wrote:

> Hi,
>
> final CachingProvider cachingProvider = Caching.getCachingProvider();
> final CacheManager cacheManager = cachingProvider.getCacheManager();
> cacheManager.createCache("c1", new MutableConfiguration<String, String>());
> cacheManager.createCache("c2", new MutableConfiguration<String, String>());
> final Collection<String> actualNames = new ArrayList<String>(2);
> for (final String s : cacheManager.getCacheNames())
> {
>     actualNames.add(s);
> }
> assertEquals(2, actualNames.size());
> assertEquals(new HashSet<String>(asList("c1", "c2")), new
> HashSet<String>(actualNames));
> cachingProvider.close();
>
> works fine so you have a setup issue somewhere - or you dont use the
> same cache manager.
>
>
>
> 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-04 3:52 GMT+02:00 sgjava <sg...@gmail.com>:
>
> > getCacheManager().getCacheNames() is not working with JCS. I get an empty
> > org.apache.commons.jcs.jcache.ImmutableIterable. The Ehcache provider
> > correctly returns a String iterator with the cache names. My tests run
> > fine,
> > but this is a good way to check that your configuration is picked up with
> > multiple caches defined.
> >
> >
> >
> > --
> > View this message in context:
> >
> http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> > Sent from the TomEE Users mailing list archive at Nabble.com.
> >
>



-- 
Steven P. Goldsmith

Re: commons-jcs-jcach getCacheNames not working

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

final CachingProvider cachingProvider = Caching.getCachingProvider();
final CacheManager cacheManager = cachingProvider.getCacheManager();
cacheManager.createCache("c1", new MutableConfiguration<String, String>());
cacheManager.createCache("c2", new MutableConfiguration<String, String>());
final Collection<String> actualNames = new ArrayList<String>(2);
for (final String s : cacheManager.getCacheNames())
{
    actualNames.add(s);
}
assertEquals(2, actualNames.size());
assertEquals(new HashSet<String>(asList("c1", "c2")), new
HashSet<String>(actualNames));
cachingProvider.close();

works fine so you have a setup issue somewhere - or you dont use the
same cache manager.



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-04 3:52 GMT+02:00 sgjava <sg...@gmail.com>:

> getCacheManager().getCacheNames() is not working with JCS. I get an empty
> org.apache.commons.jcs.jcache.ImmutableIterable. The Ehcache provider
> correctly returns a String iterator with the cache names. My tests run
> fine,
> but this is a good way to check that your configuration is picked up with
> multiple caches defined.
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>