From users-return-21467-apmail-tomee-users-archive=tomee.apache.org@tomee.apache.org Sat Sep 5 23:20:20 2015 Return-Path: X-Original-To: apmail-tomee-users-archive@www.apache.org Delivered-To: apmail-tomee-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EB0F510C23 for ; Sat, 5 Sep 2015 23:20:19 +0000 (UTC) Received: (qmail 78549 invoked by uid 500); 5 Sep 2015 23:20:19 -0000 Delivered-To: apmail-tomee-users-archive@tomee.apache.org Received: (qmail 78519 invoked by uid 500); 5 Sep 2015 23:20:19 -0000 Mailing-List: contact users-help@tomee.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@tomee.apache.org Delivered-To: mailing list users@tomee.apache.org Received: (qmail 78503 invoked by uid 99); 5 Sep 2015 23:20:19 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Sep 2015 23:20:19 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id EDD6019304F for ; Sat, 5 Sep 2015 23:20:18 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 5.213 X-Spam-Level: ***** X-Spam-Status: No, score=5.213 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_REPLY=1, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id UgPkaT_Nk8zE for ; Sat, 5 Sep 2015 23:20:06 +0000 (UTC) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com [209.85.215.43]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 21D2120382 for ; Sat, 5 Sep 2015 23:20:06 +0000 (UTC) Received: by lanb10 with SMTP id b10so32235730lan.3 for ; Sat, 05 Sep 2015 16:19:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Z0wbJ0vCFzrIsg9eCtHh8qernSqU6WpM346Qfa5rfc8=; b=rPt8Iym7xSaQyZS53d6epAtqfLSYLZFveQaVeTqT9muYrX5S4CuHGH1TqWK0BXiDBQ XJ/7U9EOcLF5fvb7qAbabF+RLgeKw312fSoECMETzaoTM/ICiS94cRbWaEdLctmHqK/V ub4PxbRIRPxPuKp1LahL5j0cEik6UrKskakbXjKbIy2bsVOVKm6OAC+51eZl6LKuSWxZ Uu2f6/uewpuDSGW48nhIvWeDfkEnB+4j+YYaMii1THyKs0aZaMGc3DfA9avFA1YlzzoW DWq0XqfU5mUOjITQa3RUJq5xE32CfFtCkske3ZH1JbwAHOLE7AqLKvcRSSm92Vv+9MDj jDqw== MIME-Version: 1.0 X-Received: by 10.112.24.163 with SMTP id v3mr10477774lbf.101.1441495198448; Sat, 05 Sep 2015 16:19:58 -0700 (PDT) Received: by 10.112.140.37 with HTTP; Sat, 5 Sep 2015 16:19:58 -0700 (PDT) Received: by 10.112.140.37 with HTTP; Sat, 5 Sep 2015 16:19:58 -0700 (PDT) In-Reply-To: References: <1441331540522-4676111.post@n4.nabble.com> Date: Sun, 6 Sep 2015 01:19:58 +0200 Message-ID: Subject: Re: commons-jcs-jcach getCacheNames not working From: Romain Manni-Bucau To: users@tomee.apache.org Content-Type: multipart/alternative; boundary=001a1135e3de3fc118051f084109 --001a1135e3de3fc118051f084109 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Le 5 sept. 2015 06:22, "Steve Goldsmith" a =C3=A9crit : > > I believe the behavior of -all- providers should be the same from a JCach= e > 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 m= e > 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 > 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" a =C3=A9cri= t : > > > > > In my mind it should show up even if it's automatically created. > > > On Sep 4, 2015 3:06 PM, "Romain Manni-Bucau" > > > wrote: > > > > > > > We can in jcs since we have it but not sure from a API point of vie= w > > what > > > > is better - trying to not use test as an excuse ;) > > > > Le 4 sept. 2015 20:42, "Steve Goldsmith" a =C3= =A9crit : > > > > > > > > > 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" a > > =C3=A9crit > > > : > > > > > > > > > > > > > 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" a > > > > =C3=A9crit > > > > > : > > > > > > > > > > > > > > > > > > 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 > > > > > > =C3=A9crit > > > > > > > : > > > > > > > > > > > > > > > > > > > > > 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 =3D > > > > > > > > Caching.getCachingProvider(); > > > > > > > > > > > > final CacheManager cacheManager =3D > > > > > > > > cachingProvider.getCacheManager(); > > > > > > > > > > > > cacheManager.createCache("c1", new > > > > > MutableConfiguration > > > > > > > > > > String>()); > > > > > > > > > > > > cacheManager.createCache("c2", new > > > > > MutableConfiguration > > > > > > > > > > String>()); > > > > > > > > > > > > final Collection actualNames =3D new > > > > > > ArrayList(2); > > > > > > > > > > > > for (final String s : cacheManager.getCacheNames()) > > > > > > > > > > > > { > > > > > > > > > > > > actualNames.add(s); > > > > > > > > > > > > } > > > > > > > > > > > > assertEquals(2, actualNames.size()); > > > > > > > > > > > > assertEquals(new HashSet(asList("c1", "c2")), > > new > > > > > > > > > > > > HashSet(actualNames)); > > > > > > > > > > > > cachingProvider.close(); > > > > > > > > > > > > > > > > > > > > > > > > works fine so you have a setup issue somewhere - or you > > > > dont > > > > > > use > > > > > > > > the > > > > > > > > > > > > same cache manager. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Romain Manni-Bucau > > > > > > > > > > > > @rmannibucau | Blog > > > > > > > > > > > > | Github < > > > > > > > > > > > > https://github.com/rmannibucau> | > > > > > > > > > > > > LinkedIn = | > > > > > > Tomitriber > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 2015-09-04 3:52 GMT+02:00 sgjava = : > > > > > > > > > > > > > > > > > > > > > > > > > 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 cach= e > > > 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-n= ot-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 --001a1135e3de3fc118051f084109--