[Java programming language only][Version 8.6.1.1 and later]

JCache overview

The JCache specification defines concepts that are similar to existing WebSphere® eXtreme Scale concepts. This product documentation briefly describes these JCache concepts and explains how eXtreme Scale integrates with JCache. For in-depth descriptions and instructions, refer to the JCache specification.

Core JCache interfaces

CachingProvider
The CachingProvider interface is the entry point into JCache. The CachingProvider interface provides function that is similar to the com.ibm.websphere.objectgrid.ObjectGridManager interface in the eXtreme Scale API. To learn how to use the CachingProvider interface, see Specifying eXtreme Scale as the CachingProvider.
CacheManager
The CacheManager interface retrieves, creates, and destroys caches. The CacheManager interface is similar to the com.ibm.websphere.objectgrid.ObjectGrid interface in the eXtreme Scale API. See [Version 8.6.1.1 and later]Retrieving an eXtreme Scale CacheManager.
Configuration
The Configuration interface defines how a Cache is configured. You can use a configuration to create a new Cache or to see the configuration of an existing Cache. The Configuration interface is similar to the com.ibm.websphere.objectgrid.BackingMap and com.ibm.websphere.objectgrid.config.BackingMapConfiguration interfaces in the eXtreme Scale API. See Configuring an eXtreme Scale Cache.
Cache
The Cache interface interacts with the cached data similar to the com.ibm.websphere.objectgrid.ObjectMap interface in the eXtreme Scale API. See Cache API in eXtreme Scale.
EntryProcessor
The EntryProcessor interface enables the application to do multiple operations on an entry. The EntryProcessor interface is similar to the com.ibm.websphere.objectgrid.datagrid.MapGridAgent interface in the eXtreme Scale API. To learn how to use the EntryProcessor interface, see Processing cache entries.

JCache plug-ins

The Java Caching API defines plug-ins that you can add to a Cache. Many of the plug-ins are similar to existing eXtreme Scale function.

CacheLoader and CacheWriter
The CacheLoader and CacheWriter interfaces enable communication with a backend to retrieve and store data. The CacheLoader and CacheWriter interface are similar to the com.ibm.websphere.objectgrid.plugins.Loader plug-in interface in the eXtreme Scale API. See Enabling cache loaders and cache writers.
CacheEntryListener
The CacheEntryListener interface enables an application to listen synchronously or asynchronously to events that occur in the Cache. The CacheEntryListener interface is similar to the com.ibm.websphere.objectgrid.plugins.ObjectGridEventListener plug-in interface in the eXtreme Scale API. See Configuring cache entry listeners.
ExpiryPolicy
The ExpiryPolicy interface enables an application to define when an entry expires from a Cache and is no longer valid. The ExpiryPolicy interface provides function similar to the time to live function in eXtreme Scale. See Configuring an ExpiryPolicy.

JCache MBeans

The JCache specification defines ways to manage JCache by using managed beans (MBeans). See Managing an eXtreme Scale Cache.

The JCache specification provides two MBeans:
  • Management MBean for listing configuration information
  • Statistics MBean for listing an assortment of cache statistics

Some JCache statistics overlap with eXtreme Scale map statistics, but JCache provides some additional statistics.

With JCache, you can enable and disable MBeans at the cache (map) level instead of at a server level. You can enable the JCache MBeans with any eXtreme Scale maps. Access the MBeans in xscmd commands, programs, or a Java console. See Ways to enable or disable JCache MBeans.

JCache interface unwrap method

Some JCache interfaces have an unwrap method that enables the application to get an instance of the underlying eXtreme Scale object. The following examples show the class to use to with the unwrap method to get the eXtreme Scale object that is associated with the JCache interface.

  • Get an ObjectGrid instance from a CacheManager:
    ObjectGrid objectGrid = (ObjectGrid) wxsCacheManager.unwrap(ObjectGrid.class);
  • Get a BackingMap instance from a Cache:
    BackingMap backingMap = (BackingMap) wxsCache.unwrap(BackingMap.class);
  • Get a CacheEntry instance from a Cache.Entry, MutableEntry, or CacheEntryEvent:
    CacheEntry cacheEntry = (CacheEntry) wxsCacheEntry.unwrap(CacheEntry.class);
  • Get a LogElement instance from a CacheEntryEvent:
    LogElement logElement = (LogElement) wxsCacheEntryEvent.unwrap(LogElement.class);

Security

Security is not covered in the JCache specification or API. The eXtreme Scale implementation of JCache provides security by using the existing security model. See Securing an eXtreme Scale Cache.

Restrictions

JCache is not supported when the eXtreme Memory (XM) function is enabled.

Topologies

The eXtreme Scale JCache documentation uses the terms local and distributed to describe different JCache topologies:

  • local means that the CacheManager runs in the same Java virtual machine (JVM) as the application. In local mode, all the data is located in the application's JVM.
  • distributed means that the CacheManager is communication with a remote eXtreme Scale data grid. In remote mode, configure catalog and containers servers to host the data grid.