[Version 5.0.2 and later]Using cache instances

Why and when to perform this task

To use cache instances you must complete the following:

Steps for this task

  1. Enable the cache instance service.
    1. Using the Administrative Console, select the application server you will use with cache instances and click Cache Instance Service.
    2. Click Start.
    The cache instance service will start when the server is started.
  2. Configure one or more cache instances.
    1. Using the Administrative Console, click Resources > Cache Instances.
    2. Specify the scope for the cache instance.

      Cell scope will make the cache instance available to all servers within the cell. Node scope will make the cache instance available to all servers on the particular node. Server scope will make the cache instance available to only the selected server. You can mix scopes if necessary.

    3. Click Apply after changing the scope.
    4. Click New.
    5. Enter the Java Naming and Directory Interface (JNDI) name for this cache instance.

      This is name you will pass to the InitialContext lookup() method from within your application. For example, services/cache/instance_one.

    6. Enter or modify other properties as needed.
  3. Update your application.
    To store and retrieve objects in a cache instance, you need a DistributedMap reference for the named cache instance. If you created a cache instance with a JNDI name of services/cache/instance_one, adding the following code to your application will return a DistributedMap reference for that cache instance:
    InitialContext ic = new InitialContext();
    	DistributedMap dm1 = (DistributedMap)ic.lookup("services/cache/instance_one");
    See the DistributedMap Javadoc for more information.

Related concepts
Cache instances
Related tasks
Using the DistributedMap interface for the dynamic cache



Searchable topic ID:   tdyn_cacheinstances
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/ae/tdyn_cacheinstances.html

Library | Support | Terms of Use | Feedback