We can introduce that method to Carbon context, but the Cache returned will
be javax.cache.Cache. Not net.sf....

Anyway, I don't think it makes any sense to add all the methods needed to
get the cache into CarbonContext. javax.cache.* has many ways of
configuring & getting the cache. It has a rich set of APIs. There can be
several cache managers and so on. Each cache can have different
configurations. The new caching implementation is also tenant aware, so the
exhibit code in the previous mail automatically tenant qualifies all calls,
and ensures that one tenant cannot try to access another tenant's caches.

Azeez


On Wed, Jun 19, 2013 at 2:57 AM, Sameera Jayasoma <[email protected]> wrote:

> Hi Azeez,
>
> Earlier we got the Cache from the CarbonContext API AFAIK. Looks like its
> not the case with the new API. I would like to ask why?
>
> Thanks,
> Sameera.
>
>
> On Tue, Jun 18, 2013 at 10:48 PM, Afkham Azeez <[email protected]> wrote:
>
>> Exhibit 1: Simple cache creation
>> -------------------------------------------
>>         CacheManager cacheManager1 =
>> Caching.getCacheManagerFactory().getCacheManager("tsampleCacheManager");
>>         Cache<String, Integer> cache =
>> cacheManager.getCache("sampleCache");
>>         int value1 = 9876;
>>         cache.put(key, value1);
>>         int value = cache.get(key).intValue()
>>
>> Exhibit 2: Using cache configuration with a custom cache expiry
>>
>> -----------------------------------------------------------------------------------
>> CacheManager cacheManager =
>> Caching.getCacheManagerFactory().getCacheManager("test");
>>         String cacheName = "cacheXXX";
>>         cache = cacheManager.<String,
>> Integer>createCacheBuilder(cacheName).
>>                 setExpiry(CacheConfiguration.ExpiryType.MODIFIED, new
>> CacheConfiguration.Duration(TimeUnit.SECONDS, 10)).
>>                 setStoreByValue(false).build();
>>         int value = 9876;
>>         cache.put(key, value);
>>         assertEquals(cache.get(key).intValue(), value);
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>> *Afkham Azeez*
>> Director of Architecture; WSO2, Inc.; http://wso2.com
>> Member; Apache Software Foundation; http://www.apache.org/
>> * <http://www.apache.org/>**
>> email: **[email protected]* <[email protected]>* cell: +94 77 3320919
>> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
>> twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
>> *
>> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
>> *
>> *
>> *Lean . Enterprise . Middleware*
>>
>> _______________________________________________
>> Architecture mailing list
>> [email protected]
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>>
>
>
> --
> Sameera Jayasoma,
> Architect,
>
> WSO2, Inc. (http://wso2.com)
> email: [email protected]
> blog: http://sameera.adahas.org
> twitter: https://twitter.com/sameerajayasoma
> flickr: http://www.flickr.com/photos/sameera-jayasoma/collections
>
>
> Lean . Enterprise . Middleware
>
> _______________________________________________
> Architecture mailing list
> [email protected]
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
>


-- 
*Afkham Azeez*
Director of Architecture; WSO2, Inc.; http://wso2.com
Member; Apache Software Foundation; http://www.apache.org/
* <http://www.apache.org/>**
email: **[email protected]* <[email protected]>* cell: +94 77 3320919
blog: **http://blog.afkham.org* <http://blog.afkham.org>*
twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
*
linked-in: **http://lk.linkedin.com/in/afkhamazeez*
*
*
*Lean . Enterprise . Middleware*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to