Java Code Examples for org.ehcache.UserManagedCache#init()

The following examples show how to use org.ehcache.UserManagedCache#init() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UserManagedCaches.java    From ehcache3 with Apache License 2.0 5 votes vote down vote up
@Test
public void userManagedCacheExample() {
  // tag::userManagedCacheExample[]
  UserManagedCache<Long, String> userManagedCache =
      UserManagedCacheBuilder.newUserManagedCacheBuilder(Long.class, String.class)
          .build(false); // <1>
  userManagedCache.init(); // <2>

  userManagedCache.put(1L, "da one!"); // <3>

  userManagedCache.close(); // <4>
  // end::userManagedCacheExample[]
}
 
Example 2
Source File: TestUserManagedCache.java    From jframe with Apache License 2.0 5 votes vote down vote up
public void init() {
    UserManagedCache<Long, String> userManagedCache = UserManagedCacheBuilder
            .newUserManagedCacheBuilder(Long.class, String.class).build(false);
    userManagedCache.init();

    userManagedCache.put(1L, "da one!");

    userManagedCache.close();
}
 
Example 3
Source File: TestEhcache.java    From jframe with Apache License 2.0 5 votes vote down vote up
@Test
@Ignore
public void userManagedCacheTest() {
    UserManagedCache<Long, String> userManagedCache = UserManagedCacheBuilder
            .newUserManagedCacheBuilder(Long.class, String.class).build(false);
    userManagedCache.init();

    userManagedCache.put(1L, "da one!");
    userManagedCache.close();

    String value = userManagedCache.get(1L);
    LOG.info(value);
}