Refreshing policy set and general bindings configurations using wsadmin scripting

You can use the wsadmin tool to refresh the policy set and general bindings configuration data. This is done by refreshing the PolicySetManager object. If you change the settings in a policy set or general bindings after it has been loaded by an application, the PolicySetManager must be refreshed before the changes are recognized by the application server. After refreshing the PolicySetManager, any applications that are using a policy set or general bindings that were changed will not pick up the changes until they are restarted.

Procedure

  1. Launch the wsadmin scripting tool using the Jython scripting language.
  2. Get the object name of each PolicySetManager object.
    Use the completeObjectName option for the AdminControl object to set the object name for each PolicySetManager type object to the objNameString variable, as the following example demonstrates:
    objNameString = AdminControl.completeObjectName('type=PolicySetManager,*')
  3. Connect to the Managed Bean (MBean).
    The MBean supplies a remote interface to the MBean server that runs in the application server. The following example shows how to look up the MBean:
    import javax.management as mgmt
  4. Set the PolicySetManager MBean object name.
    The following example sets the PolicySetManager MBean object name to the mbeanObj variable, parameters to the param variable, and signature settings to the sig variable:
    mbeanObj = mgmt.ObjectName(objNameString)
    param=[]
    sig=[]
  5. Refresh the PolicySetManager MBean.
    The following example refreshes the policy set configuration:
    AdminControl.invoke_jmx(mbeanObj, 'refresh', param, sig)

Example

The following example is a Jython script that refreshes the policy set manager:
objNameString = AdminControl.completeObjectName('type=PolicySetManager,*')
import javax.management as mgmt
mbeanObj = mgmt.ObjectName(objNameString)
param=[]
sig=[]
AdminControl.invoke_jmx(mbeanObj, 'refresh', param, sig)
The following example is a Jacl script that refreshes the policy set manager:
set psm [$AdminControl queryNames type=PolicySetManager,*]
$AdminControl invoke $psm refresh