I have a simple third party object - a DTO with about 10+ public fields only (it get filled as an atomic operation). I would like to be able to monitor it in JConsole without writing a lot of boilerplate code.
I tried to:
- Use MXBean - got an exception (NotCompliantMBeanException)
- Convert the DTO to String using reflection-based utility library like apache.common.lang3.ReflectionToStringBuilder - works, but does not look good since JConsole does not support multi-line strings well, plus it is not efficient.
Any other suggestions?