In the following code, the getTestBean() method returns an instance of
a public inner class that implements HtmlContent. In the Jminix Mini
Console, clicking on the TestBean attribute will render the results of
the toString() as HTML. Note that the method uses the
@ManagedAttribute annotation; as I understand it, HTML rendering is
not currently supported for @ManagedOperations in Jminix 1.0.0.
Hopefully this example will save someone a bit of time.
Mark
import org.jminix.type.HtmlContent;
import org.springframework.jmx.export.annotation.ManagedAttribute;
import org.springframework.jmx.export.annotation.ManagedResource;
@ManagedResource(objectName="mds:name=TestJMXMonitor")
public class TestJMXMonitor implements HtmlContent {
@ManagedAttribute(description = "Some ID.")
public Integer getID() {
return 555;
}
@ManagedAttribute(description = "Test Operation.")
public TestBean getTestBean() {
return new TestBean();
}
public class TestBean implements HtmlContent {
public String toString() {
return "<p>paragraph 1</p><p><b>bolder</b> text</p>";
}
}
}