Using the DistributedMap and DistributedObjectCache interfaces for the dynamic cache
By using the DistributedMap or DistributedObjectCache interfaces, Java™ Platform, Enterprise Edition (Java EE) applications and system components can cache and share Java objects by storing a reference to the object in the cache.
About this task
The DistributedMap and DistributedObjectCache interfaces are simple interfaces for the dynamic cache. Using these interfaces, Java EE applications and system components can cache and share Java objects by storing a reference to the object in the cache. The default dynamic cache instance is created if the dynamic cache service is enabled in the administrative console. This default instance is bound to the global Java Naming and Directory Interface (JNDI) namespace using the name services/cache/distributedmap.
Multiple instances of the DistributedMap and DistributedObjectCache interfaces on the same Java virtual machine (JVM) enable applications to separately configure cache instances as needed. Each instance of the DistributedMap interface has its own properties.
Place JAR files in a shared library when you deploy the application in a cluster with replication enabled. Simply turning on replication does not require a shared library; however, if you are using application-specific Java objects, such as cache key or cache value, those Java classes are required to be in the shared library.
- Configuring the default object cache (method one in Procedure)
- Creating and configuring the custom object cache (method three in Procedure)
- Creating and configuring the custom object cache by using the cacheinstances.properties file (method four in Procedure)
- Using the resource reference (method five in Procedure)