Skip to Content »

online discount medstore
advair diskus for sale
buy advair diskus without prescription
allegra for sale
buy allegra without prescription
aristocort for sale
buy aristocort without prescription
astelin for sale
buy astelin without prescription
atarax for sale
buy atarax without prescription
benadryl for sale
buy benadryl without prescription
buy clarinex without prescription
clarinex for sale
buy claritin without prescription
claritin for sale
buy flonase without prescription
flonase for sale
buy ventolin without prescription
ventolin for sale
amoxil for sale
buy amoxil without prescription
augmentin for sale
buy augmentin without prescription
bactrim for sale
buy bactrim without prescription
biaxin for sale
buy biaxin without prescription
buy cipro without prescription
cipro for sale
buy cleocin without prescription
cleocin for sale
buy dexone without prescription
dexone for sale
buy flagyl without prescription
flagyl for sale
buy levaquin without prescription
levaquin for sale
buy omnicef without prescription
omnicef for sale
amaryl for sale
buy amaryl without prescription
buy cozaar without prescription
cozaar for sale
buy diabecon without prescription
diabecon for sale
buy glucophage without prescription
glucophage for sale
buy glucotrol without prescription
glucotrol for sale
buy glucovance without prescription
glucovance for sale
buy micronase without prescription
micronase for sale
buy prandin without prescription
prandin for sale
buy precose without prescription
precose for sale
buy cialis professional without prescription
cialis professional for sale
buy cialis soft without prescription
cialis soft for sale
buy cialis super active without prescription
cialis super active for sale
buy cialis without prescription
cialis for sale
buy levitra without prescription
levitra for sale
buy viagra professional without prescription
viagra professional for sale
buy viagra soft without prescription
viagra soft for sale
buy viagra super active without prescription
viagra super active for sale
buy viagra super force without prescription
viagra super force for sale
buy viagra without prescription
viagra for sale
buy celebrex without prescription
celebrex for sale
buy colcrys without prescription
colcrys for sale
buy feldene without prescription
feldene for sale
buy imitrex without prescription
imitrex for sale
buy inderal without prescription
inderal for sale
buy indocin without prescription
indocin for sale
buy naprosyn without prescription
naprosyn for sale
buy pletal without prescription
pletal for sale
buy robaxin without prescription
robaxin for sale
buy voltaren without prescription
voltaren for sale

Tech Life of Recht » archive for 'jmx'

 JMX: Overlooked technology?

  • May 13th, 2008
  • 10:16 pm

I’ve been somewhat busy lately, primarily with courses and our SAML project. Last week, we held a 5 day course on Java EE 5, and I had been blessed with the task of talking about WS-Security and SAML. Not strictly JEE5, but the customer wanted to hear something about it, so somebody had to do it. Naturally, the BlackHole(tm) effect kicked in, and I was chosen as the most competent. Enough about that, in a later post I’ll probably write something about my experiences with OpenSAML and XML Encryption.

One of the other topics in the course was JMX, and it hit me that even though people knew JMX, they didn’t quite know the available tools. The technology itself hasn’t changed in quite a long time, but it still seems to somewhat overlooked. JMX is nice because it’s so easy to add monitoring capabilities to your application. Of course, there are limits as to how much functionality you can (and want) to expose through JMX, but common cases are statistics, logging configuration, job scheduling, and other things which you don’t necessarily want to build a dedicated interface for. This makes even more sense when you’re not developing a web application but some sort of server.

For those who don’t know it, JMX is pretty simple, especially since Java5:
[code]

public interface TestMBean {
public void restartServer();
}

public class Test implements TestMBean {
public void restartServer() {
System.out.println(“Restarting server”);
}
}

MBeanServer server = ManagementFactory.getPlatformMBeanServer();
ObjectName name = new ObjectName(“appname”, “type”, “server”);
server.registerMBean(new Test(), name);
[/code]

That’s more or less it. Now the TestMBean can be monitored through JMX using a JMX console – which brings me to one of the overlooked programs in the JDK: JConsole. With JConsole, which is a part of the standard JDK, it’s possible to monitor any JMX MBean server, including the JDK itself. Simply fire up JConsole and connect to a process. Under the MBeans tab, you can see all the registered MBeans. The other tabs contain VM information – The threads tab can also be quite useful for looking at stack traces for individual threads without attaching a debugger.