Creating a Management Bean

An MBean’s purpose is to help manage your application. Many Ruby applications provide this same kind of interface with RESTful services, but those tend to get in the way of the real application. MBeans provide a better interface because they’re separated from the rest of the application, which means they have their own security, port, and graphical interface. As a result, there’s less of a chance that an ordinary user will accidentally (or intentionally) gain access to the management services.

Let’s create an MBean that you can use to manage the logging level of your Rails application. You’ll start by adding the jmx4r gem to your Gemfile and running Bundler.

 gem ​'jmx4r'

Next, create ...

Get Deploying with JRuby 9k now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.