Managing deployed solutions by using MBean APIs

You can manage deployed solutions by using the SolutionsMXBean Java™ Management Extensions (JMX) management bean (MBean) API to list solutions and retrieve or set properties. The Liberty server provides MBeans and corresponding management interface APIs that you can use to manipulate and monitor solutions.

About this task

Use the SolutionsMXBean APIs to retrieve information about deployed solutions, and to get and set properties that apply to solutions. The management interface for the SolutionsMXBean API is com.ibm.ia.runtime.management.SolutionsMXBean.

Procedure

  1. Connect to the MBean server and create an MBeanServer instance for the Decision Server Insights application code that is running on the Liberty profile. For more information, see Connecting to the MBean server.
  2. Activate the MBean interface by calling the javax.management.JMX.newMXBeanProxy method, which enables the MXBeans to obtain a proxy object. See Working with JMX MBeans on the Liberty profile in the Liberty documentation.
  3. Retrieve a list of the deployed solutions, as shown in the following example.
    CompositeData [] solutions = (CompositeData []) mbsc.getAttribute(new ObjectName("com.ibm.ia:type=Solutions"), "Solutions");
    for (int index = 0; index < solutions.length; index++) 
    {
    	CompositeData solution = solutions[index];
    	CompositeType compositeType = solution.getCompositeType();
    	Set<String> keys = compositeType.keySet();
    	Iterator keysIter = keys.iterator();
    	while (keysIter.hasNext()) 
    	{
    		String key = (String) keysIter.next();
    		Object value = solution.get(key);
                			
    	}	
    }