Using the DistributedMap and DistributedObjectCache interfaces for the dynamic cache

Using the DistributedMap and DistributedObjectCache interfaces for the dynamic cache

By using the DistributedMap or DistributedObjectCache interfaces, Java 2 platform, Enterprise Edition (J2EE) applications and system components can cache and share Java objects by storing a reference to the object in the cache.

Enable the dynamic cache service. See Enabling the dynamic cache service for more information.

The DistributedMap and DistributedObjectCache interfaces are simple interfaces for the dynamic cache. Using these interfaces, J2EE 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 that can be set using Object cache instance settings.

Tip: For more information about the DistributedMap and DistributedObjectCache interfaces, see the API documentation for the com.ibm.websphere.cache package. See Reference: Generated API documentation for more information.

Important: If you are using custom object keys, place your classes in a shared library. You can define the shared library at cell, node, or server level. Then, in each server create a class loader and associate it with the shared library that you defined. See Managing shared libraries and Class loader settings for more information.

There are three methods for configuring and using cache instances.

 

What to do next

To learn how to share cached objects in a clustered environment, see Shared cached objects in a clustered environment.


Sub-topics
Shared cached objects in a clustered environment
Object cache instance settings
Object cache instance collection
Invalidation listeners

Related concepts
Cache instances

Related tasks
Enabling the dynamic cache service
Configuring dynamic cache disk offload
Using object cache instances
Task overview: Using the dynamic cache service to improve performance

Related reference