IBM BPM, V8.0.1, All platforms > Administer the IT infrastructure > Administer access to WSRR > Clearing the cache associated with a WSRR definition

Example: Clearing the cache from the command line

This example shows you how to clear the cache associated with a WSRR definition, from the command line.

This example uses the command-line scripting tool, wsadmin. For more information about the WebSphere Application Server tool, wsadmin, see: Commands (wsadmin scripting).

When mediation flows query a registry, the information returned is stored in a cache associated with the WSRR definition (information relating to service endpoints and mediation policies can be cached).

Before you can clear the cache, using wsadmin, you need to have a reference to an MBean of type ServiceRegistry. You must get a ServiceRegistry MBean for each instance of the registry you need to clear; then you use the MBeans to clear the cache.

A ServiceRegistry MBean is created when an WSRR instance, as defined by a WSRR definition, is queried for the first time by an Endpoint Lookup mediation primitive or a Policy Resolution mediation primitive.


Procedure

  1. From a command line, start wsadmin.

  2. From wsadmin, retrieve a reference to a specific ServiceRegistry MBean.

    For example,

    wsadmin>set wsrrDef [$AdminControl completeObjectName
    WebSphere:type=ServiceRegistry,mbeanIdentifier=testWSRR1,*]
    This example, uses JACL to set a reference to a ServiceRegistry MBean in the variable wsrrDef.

    In an ND environment there might be several instances of each ServiceRegistry MBean, each of which would require the cache to be cleared.

  3. Invoke the expireCache operation on the ServiceRegistry MBean whose reference you have retrieved.

    For example:

    wsadmin>$AdminControl invoke $wsrrDef expireCache
    .


Results

The cache, associated with an instance of a ServiceRegistry MBean, is cleared.

Clearing the cache associated with a WSRR definition