JMX is used to manage your application (or even the application server). It's a very simple 3-step process.
- You write your Management Beans or MBeans to provide the management functionality.
- Then your register your MBean with the MBean Agent (MBean Server).
- Now you can manage your application by connecting to the MBean Server and calling the required functionality.
The decision of when to forgo the use of configuration files and code to update settings and when to use JMX is not clear-cut. It's definitely a better idea when program management forms a larger part since JMX is very scalable. But I think JMX is an even better idea when you have limited managment requirements and don't want to add a custom user interface module just for the management. In this case, JMX allows you to provide the neccessary interface with just 10 lines of code and use of the ubiquitous JConsole to do the agent connection (see my Using JConsole to connect to an MBeanServer post on how to use JConsole for this).