Custom Data Format

From jManage

jManage comes with a set of default data formatters configured in html-data-format.properties (for Web interface) and text-data-format.properties (for command line interface). You can configure your custom data formatters in these files. The compiled custom data formatters should be placed as a jar file under the jManage lib directory.

Data formatters for data types are specified as:

format.mypackage.MyData=mypackage2.MyDataFormat

For example:

format.javax.management.openmbean.CompositeData=org.jmanage.core.management.data.HtmlCompositeDataFormat

You can also specify custom data formatters based on the result of CompositeType.getTypeName(). These formatters are specified as:

CompositeTypeFormat.<typeName>=mypackage.MyDataFormat

For example:

CompositeTypeFormat.java.lang.management.ThreadInfo=org.jmanage.core.management.data.jdk.ThreadInfoFormat

The custom data format classes extend the following interface:

package org.jmanage.core.management.data;
public interface DataFormat {
   public String format(Object data);
}