This example shows you how to clear the cache associated
with a WSRR definition, from the command line.
Before you begin
This example uses the command-line scripting tool, wsadmin. For more information about the WebSphere® Application Server tool, wsadmin,
see: Commands (wsadmin scripting).
About this task
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.
Note: 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
- From a command line, start wsadmin.
- 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.
Note: In a network deployment
environment there might be several instances of each ServiceRegistry
MBean, each of which would require the cache to be cleared.
- 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.
This topic only applies to BAW, and is located in the BAW repository. Last updated on 2025-01-20 10:38