Package javax.cache.spi

Examples of javax.cache.spi.CachingProvider


  public void accessStatistics() throws MalformedObjectNameException,
      AttributeNotFoundException, MBeanException, ReflectionException,
      InstanceNotFoundException {

    CachingProvider cachingProvider = Caching.getCachingProvider();
    CacheManager cacheManager = cachingProvider.getCacheManager();

    MutableConfiguration<String, Integer> config =
        new MutableConfiguration<String, Integer>();
    config.setTypes(String.class, Integer.class)
        .setExpiryPolicyFactory(AccessedExpiryPolicy.factoryOf(ONE_HOUR))
View Full Code Here


*/
public class TypeSafety {

  @Test
  public void runtimeTypeEnforcement() {
    CachingProvider cachingProvider = Caching.getCachingProvider();
    CacheManager cacheManager = cachingProvider.getCacheManager();

    MutableConfiguration<String, Integer> config = new
        MutableConfiguration<>();
    config.setTypes(String.class, Integer.class);

View Full Code Here

   * an {@link EntryProcessor}.
   */
  @Test
  public void incrementValue() {

    CachingProvider provider = Caching.getCachingProvider();
    CacheManager manager = provider.getCacheManager();

    MutableConfiguration<String, Integer> configuration =
      new MutableConfiguration<String, Integer>()
        .setTypes(String.class, Integer.class);

View Full Code Here

public class CompletionListenerExamples {


  public void completionListenerExample() {

    CachingProvider cachingProvider = Caching.getCachingProvider();
    CacheManager cacheManager = cachingProvider.getCacheManager();

    MutableConfiguration<String, Integer> config = new MutableConfiguration<>();
    config.setTypes(String.class, Integer.class)
        .setExpiryPolicyFactory(AccessedExpiryPolicy.factoryOf(ONE_HOUR))
        .setStatisticsEnabled(true);
View Full Code Here

  @Test
  public void simpleAPITypeEnforcement() {

    //resolve a cache manager
    CachingProvider cachingProvider = Caching.getCachingProvider();
    CacheManager cacheManager = cachingProvider.getCacheManager();

    //configure the cache
    MutableConfiguration<String, Integer> config = new MutableConfiguration<>();
    //uses store by reference
    config.setStoreByValue(false)
View Full Code Here

        }

        public CachingProvider getCachingProvider(ClassLoader classLoader) {
            Iterator<CachingProvider> iterator = getCachingProviders(classLoader).iterator();
            if (iterator.hasNext()) {
                CachingProvider provider = iterator.next();
                if (iterator.hasNext()) {
                    throw new CacheException("Multiple CachingProviders have been configured when only a single CachingProvider is expected");
                } else {
                    return provider;
                }
View Full Code Here

            if (providers == null) {
                getCachingProviders(serviceClassLoader);
                providers = cachingProviders.get(serviceClassLoader);
            }

            CachingProvider provider = providers.get(fullyQualifiedClassName);
            if (provider == null) {
                provider = loadCachingProvider(fullyQualifiedClassName, serviceClassLoader);
                providers.put(fullyQualifiedClassName, provider);
            }
View Full Code Here

TOP

Related Classes of javax.cache.spi.CachingProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.