Package com.kylin.infinispan.helloworld.namedCache

Source Code of com.kylin.infinispan.helloworld.namedCache.HelloWroldXmlConfiguredCache

package com.kylin.infinispan.helloworld.namedCache;

import java.io.IOException;

import org.infinispan.Cache;
import org.infinispan.manager.DefaultCacheManager;
import org.infinispan.manager.EmbeddedCacheManager;

import com.kylin.infinispan.common.User;

public class HelloWroldXmlConfiguredCache {

  public static void main(String[] args) throws IOException {

    EmbeddedCacheManager manager = new DefaultCacheManager("infinispan.xml");

    Cache<Object, Object> cache = manager.getCache("xml-configured-cache");

    for (int i = 0; i < 10; i++) {
      cache.put("key-" + i, new User(i, "Kylin Soong", "IT"));
    }

    for (int i = 0; i < 10; i++) {
      System.out.println(cache.get("key-" + i));
    }
  }

}
TOP

Related Classes of com.kylin.infinispan.helloworld.namedCache.HelloWroldXmlConfiguredCache

TOP
Copyright © 2018 www.massapi.com. 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.