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
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to