Spring Boot and Working With MBeans [Snippet]

The following example demonstrates how one can manage object operation remotely via the JMX Console. Once you declare your object as MBeans, one can extend the example to apply remote logging without changing log4j, which is very useful in production environments, evicting cache or any other operation that needs to be handled remotely via MBean/JMX.

 @ManagedResource: This Spring annotation applies on the Class Level, and this will declare it as an MBean.