[Java programming language only]

Customizing a dynamic cache instance with custom properties

You can set custom properties on a dynamic cache instance in WebSphere® Application Server.

Before you begin

You must have a default cache instance or an extra object or servlet type cache instance configured. See Configuring the default dynamic cache instance (baseCache) or Configuring object or servlet dynamic cache instances.

About this task

You can set a custom properties specific to a particular for a dynamic cache instance in one of the following ways:
  • Use the WebSphere Application Server administrative console with APAR PM71992 if you want to set custom properties specific to a particular dynamic cache instance. If you do not have this fix, contact WebSphere Application Server Support page at http://www.ibm.com/software/webservers/appserv/was/support.
  • If you created a cacheinstances.properties file, you can set custom properties within that file. This method cannot be used to set custom properties for a default dynamic cache (baseCache) instance.
  • Use the WebSphere Application Server administrative console to change the values of Java virtual machine (JVM) custom properties.
    Note: Any JVM properties set might affect all cache instances that are used within a particular JVM.
    Note: The scope for JVM properties can span to all cache instances within a WebSphere Application Server JVM. Therefore, using cache-specific custom properties in theWebSphere Application Server administrative console (with APAR PM71992 for a default cache instance) or using a cacheinstances.properties file are preferable in most circumstances.

Procedure

  • To set a custom property on a cache instance in the WebSphere Application Server administrative console, use the following steps:
    1. Start the WebSphere Application Server administrative console.
      Note: These steps cannot be used for a default (baseCache) instance until you apply WebSphere Application Server APAR PM71992. This fix is available in WebSphere Application Server versions 7.0.0.27, 8.0.0.6, and 8.5.0.2 and greater. If you do not have this fix, contact WebSphere Application Server Support page at http://www.ibm.com/software/webservers/appserv/was/support.
    2. Select the cache instance you configured.
    3. From the cache instance panel, click Additional Properties > Custom Properties.
    4. Select New and specify the name of the custom property name and value.
    5. Click Apply or OK and save the configuration.
    6. Restart the Deployment Manager and all application server processes.
  • To set a custom property for a cache instance with the cacheinstances.properties file, use the following steps:
    Note: These steps cannot be used for a default (baseCache) instance.
    1. Add the custom property to a cacheinstances.properties file.
      If you must create this file, see Cache instances properties file for required contents.
    2. Place the cacheinstances.properties file in either your application server or application class path. For example, you can use your application WAR (Web application archive) file, WEB-INF\classes directory or create a server_root\classes directory and place the file there.
  • Use the WebSphere Application Server administrative console to change the values of Java virtual machine (JVM) custom properties.
    For more information, see Java virtual machine custom properties.