WSO2 Carbon Caching - OSGi Tests

WSO2 is an open source application development software company focused on providing service-oriented architecture solutions for professional developers.

License

License

Categories

Categories

Caching Data
GroupId

GroupId

org.wso2.carbon.caching
ArtifactId

ArtifactId

org.wso2.carbon.caching.osgi.tests
Last Version

Last Version

1.1.3
Release Date

Release Date

Type

Type

bundle
Description

Description

WSO2 Carbon Caching - OSGi Tests
WSO2 is an open source application development software company focused on providing service-oriented architecture solutions for professional developers.
Project URL

Project URL

http://wso2.com
Project Organization

Project Organization

WSO2

Download org.wso2.carbon.caching.osgi.tests

Dependencies

compile (3)

Group / Artifact Type Version
javax.cache : cache-api jar 1.0.0
org.wso2.carbon.caching : org.wso2.carbon.caching jar 1.1.3
org.wso2.carbon : org.wso2.carbon.container jar 5.2.0-m3

test (33)

Group / Artifact Type Version
org.wso2.eclipse.osgi » org.eclipse.osgi jar 3.10.2.v20150203-1939
org.wso2.eclipse.osgi » org.eclipse.osgi.services jar 3.4.0.v20140312-2051
org.wso2.carbon : org.wso2.carbon.core jar 5.2.0-m3
org.testng : testng jar 6.9.4
org.ops4j.pax.logging : pax-logging-api jar 1.8.4
org.ops4j.pax.logging : pax-logging-log4j2 jar 1.8.4
org.wso2.eclipse.equinox » org.eclipse.equinox.simpleconfigurator jar 1.1.0.v20131217-1203
org.ops4j.pax.exam : pax-exam jar 4.9.1
org.ops4j.pax.exam : pax-exam-container-native jar 4.6.0
org.ops4j.pax.exam : pax-exam-testng jar 4.6.0
org.ops4j.pax.exam : pax-exam-link-mvn jar 4.6.0
org.ops4j.pax.url : pax-url-aether jar 1.6.0
org.slf4j : slf4j-api jar 1.7.12
org.ow2.spec.ee : ow2-jta-1.1-spec jar 1.0.12
org.jacoco : org.jacoco.ant jar 0.7.5.201505241946
org.apache.felix : org.apache.felix.gogo.command jar 0.10.0.v201209301215
org.apache.felix : org.apache.felix.gogo.runtime jar 0.10.0.v201209301036
org.apache.felix : org.apache.felix.gogo.shell jar 0.10.0.v201212101605
org.wso2.eclipse.equinox » org.eclipse.equinox.app jar 1.3.200.v20130910-1609
org.wso2.eclipse.equinox » org.eclipse.equinox.console jar 1.1.0.v20140131-1639
org.wso2.eclipse.equinox » org.eclipse.equinox.common jar 3.6.200.v20130402-1505
org.wso2.eclipse.equinox » org.eclipse.equinox.concurrent jar 1.1.0.v20130327-1442
org.wso2.eclipse.equinox » org.eclipse.equinox.ds jar 1.4.200.v20131126-2331
org.wso2.eclipse.equinox » org.eclipse.equinox.frameworkadmin jar 2.0.100.v20131209-2144
org.wso2.eclipse.equinox » org.eclipse.equinox.frameworkadmin.equinox jar 1.0.500.v20131211-1531
org.wso2.eclipse.equinox » org.eclipse.equinox.launcher jar 1.3.0.v20140415-2008
org.wso2.eclipse.equinox » org.eclipse.equinox.preferences jar 3.5.200.v20140224-1527
org.wso2.eclipse.equinox » org.eclipse.equinox.registry jar 3.5.400.v20140428-1507
org.wso2.eclipse.equinox » org.eclipse.equinox.simpleconfigurator.manipulator jar 2.0.0.v20131217-1203
org.wso2.eclipse.equinox » org.eclipse.equinox.util jar 1.0.500.v20130404-1337
org.wso2.eclipse.equinox » org.eclipse.equinox.cm jar 1.1.0.v20131021-1936
org.wso2.orbit.org.yaml : snakeyaml jar 1.16.0.wso2v1
org.wso2.carbon.caching » wso2carbon-caching-test zip 1.1.3

Project Modules

There are no modules declared in this project.

JSR 107 (JCache) Implementation for WSO2 Carbon

This Carbon component implements JCache 1.0 for Carbon.

For details about JCache, see the specification

Usage

Example usage:

Creating a Cache

CachingProvider provider = cachingService.getCachingProvider();
CacheManager cacheManager = provider.getCacheManager();
        
//configure the cache
MutableConfiguration<String, String> config = new MutableConfiguration<>();
config.setStoreByValue(true)
        .setTypes(String.class, String.class)
        .setExpiryPolicyFactory(AccessedExpiryPolicy.factoryOf(cacheExpiry))
        .setStatisticsEnabled(false);

//create the cache
Cache<String, String> = cacheManager.createCache("myCache", config);

Note that cachingService in the above code segment is the org.wso2.carbon.caching.CarbonCachingService OSGi service

Getting the cache and performing operations on it

String cacheName = "myCache";
String key = "k";
String value = "v";
Cache<String, String> cache = cacheManager.getCache(cacheName, String.class, String.class);

// Add to cache
cache.put(key, value);

// Get from cache
String val = cache.get(key);

// Remove from cache
cache.remove(key);

For full source code, see caching sample.

For more details about the JCache APIs, please refer to the JCache Java docs

org.wso2.carbon.caching

WSO2

Welcome to the WSO2 source code! For info on working with the WSO2 repositories and contributing code, click the link below.

Versions

Version
1.1.3
1.1.2
1.1.1
1.1.0
1.0.0
1.0.0-m1