Using object cache instances

Perform this task so that your application can access dynamic cache object cache instances with the DistributedMap or DistributedObjectCache interfaces.

Before you begin

Before you begin, enable the dynamic cache service. See 동적 캐시 서비스 사용 for more information.

About this task

Using object cache instances can improve the performance of your application because you can programmatically store and share frequently used objects. By using object cache instances, you also have the necessary control over the dynamic cache when you are running multiple applications in an application server. See 캐시 인스턴스 for more information.

Procedure

  1. Configure one or more cache instances.
    1. In the administrative console, click Resources > Cache instances > Object cache instances.
    2. Specify the scope for the cache instance.

      Cell scope makes the cache instance available to all servers within the cell. Node scope makes the cache instance available to all servers on the particular node. Cluster scope makes the cache instance available to all members in a specified cluster. Server scope makes the cache instance available to only the selected server. You can mix scopes, if necessary.

      Node scope makes the cache instance available to all servers on the particular node. Server scope makes the cache instance available to only the selected server. You can mix scopes, if necessary.

      Note: You cannot create cache instances (object or servlet) at different scopes with the same cache name or JNDI name.
    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 that you pass to the InitialContext lookup() method from within your application. For example, services/cache/instance_one.

    6. Enter or modify other properties as needed.
  2. Update your application. To store and retrieve objects in an object cache instance, you need a DistributedMap or DistributedObjectCache reference for the named object cache instance. See 동적 캐시에 DistributedMap 및 DistributedObjectCache 인터페이스 사용 for more information.

Results

You configured object cache instances that you can access programmatically with the DistributedMap and DistributedObjectCache interfaces.

What to do next

See 추가 API(Application Programming Interface) for more information about the DistributedMap or DistributedObjectCache interfaces.

주제 유형을 표시하는 아이콘 태스크 주제



시간소인 아이콘 마지막 업데이트 날짜: July 9, 2016 6:10
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=tdyn_cacheinstances
파일 이름:tdyn_cacheinstances.html