Hi Nuwan,

You can use the CachingConstants.LOCAL_CACHE_PREFIX constant value as
defined in [1], You need to use two under score values.

[1].
https://github.com/wso2/carbon-kernel/blob/4.4.x/core/javax.cache/src/main/java/org/wso2/carbon/caching/impl/CachingConstants.java#L36

Regards,
Aruna

On Wed, Jul 6, 2016 at 4:26 PM, Nuwan Dias <[email protected]> wrote:

> Hi,
>
> How can we create a cache instance that's local to the running JVM? I
> tried using a cache name which has a prefix as "$_local_$.", but it doesn't
> seem to work. Meaning that when I have two nodes in the same cluster, when
> the cache is created on one node, the cache get I do on the other node
> returns the cached object. Which means that this cache is still a
> distributed cache. Is there anything wrong I'm doing or any other ways to
> achieve $subject?
>
> The code I use to get the cache instance is as below.
>
> Caching.getCacheManager(
>         
> APIConstants.API_MANAGER_CACHE_MANAGER).getCache("$_local_$.GATEWAY_TOKEN_CACHE");
>
>
> Thanks,
>
> NuwanD.
>
> --
> Nuwan Dias
>
> Technical Lead - WSO2, Inc. http://wso2.com
> email : [email protected]
> Phone : +94 777 775 729
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 

*Aruna Sujith Karunarathna *
WSO2, Inc | lean. enterprise. middleware.
#20, Palm Grove, Colombo 03, Sri Lanka
Mobile: +94 71 9040362 | Work: +94 112145345
Email: [email protected] | Web: www.wso2.com
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to