Package com.kylin.infinispan.common

Examples of com.kylin.infinispan.common.User


    System.out.println("name = " + cache.getName() + ", version = " + cache.getVersion() + ", status = " + cache.getStatus());
    System.out.println("name = " + cache01.getName() + ", version = " + cache01.getVersion() + ", status = " + cache01.getStatus());
    System.out.println("name = " + cache02.getName() + ", version = " + cache02.getVersion() + ", status = " + cache02.getStatus());
    System.out.println("name = " + cache03.getName() + ", version = " + cache03.getVersion() + ", status = " + cache03.getStatus());
   
    cache.put("key", new User(1, "Kylin Soong", "IT"));
   
    System.out.println(cache.size());
    System.out.println(cache.containsKey("key"));
    System.out.println(cache.get("key"));
   
    Object obj = cache.remove("key");
    System.out.println(obj);
    System.out.println(cache.size());
   
    cache.put("key", new User(1, "Kylin Soong", "Software Engineer"));
    cache.put("key", new User(2, "Kobe Bryant", " Basketball Player"));
    System.out.println(cache.get("key"));
   
    cache.put("key", new User(1, "Kylin Soong", "Software Engineer"), 5, TimeUnit.SECONDS);
    System.out.println(cache.get("key"));
    Thread.sleep(5 * 1000);
    System.out.println(cache.get("key"));
  }
 
View Full Code Here


    manager.defineConfiguration("named-cache", new ConfigurationBuilder().eviction().strategy(EvictionStrategy.LIRS).maxEntries(10).build());
   
    Cache<Object, Object> cache = manager.getCache("named-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));
    }
View Full Code Here

    props.put("infinispan.client.hotrod.server_list", "127.0.0.1:11222");
    RemoteCacheManager cacheManager = new RemoteCacheManager(props);
    RemoteCache<Object, Object> cache = cacheManager.getCache();
   
    for(int i = 0 ; i < 1000000 ; i ++) {
      cache.put("key---" + i, new User(i, "Kylin Soong", "SoftWare Engineer"));
    }
   
    System.out.println(cache.size());
   
    Thread.sleep(Long.MAX_VALUE);
View Full Code Here

    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));
    }
View Full Code Here

    RemoteCacheManager cacheManager = new RemoteCacheManager(props);
    RemoteCache<Object, Object> cache = cacheManager.getCache();

    System.out.println(cache);

    cache.put("key", new User(1, "Kylin Soong", "IT"));

    System.out.println(cache.size());

    System.out.println(cache.get("key"));
View Full Code Here

TOP

Related Classes of com.kylin.infinispan.common.User

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.