views:

273

answers:

6

I am designing a J2SE application, and looking for a solution for monitoring and alerts. The requirements are:

  1. Objects can report their status and issue alerts when they have problems.
  2. Calling some pre-defined methods on specific objects (e.g. to dump their state).
  3. Monitoring JVM health, especially memory usage.
  4. Preferably access all of the above from a remote computer.

What would be the best solution for that? Anything involving JMX?

+1  A: 

Yes, you're describing pretty much JMX and MBeans.

Joachim Sauer
+1  A: 

you can use smartinspect , you can log whatever u want in ur app, objects , picture , ... and you can also have access to them from remote computer

Adinochestva
+1  A: 

See JConsole, which is packaged with the Java install. This allows you to inspect JMX-available statistics, whether on local or remote machines. You need to start up your monitored VM with the appropriate options (detailed in the linked article) and then simply start JConsole and point to the required VM (you can secure via authentication if you require).

JConsole can inspect all the standard JMX beans, plus any that you create/register. The GUI will allow you to call exposed methods, and chart statistics etc.

Brian Agnew
+1  A: 

If you use Java 6u10 or later, also see VisualVM (jvisualvm.exe in the JDK) which can do all kinds of interesting things, including (with a plugin) the same things jconsole can.

It is really great for inspecting.

Thorbjørn Ravn Andersen
A: 

If you want to throw alerts into the mix too, have a look at Jopr (http://www.jboss.org/jopr/)

Heiko Rupp
A: 
Kire Haglin