Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 15th, 2012  |  syntax: None  |  size: 0.34 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. JMX get MBeanAttributeInfo of specific attribute directly
  2. //server is an MBeanServer
  3. MBeanAttributeInfo[] infos = server.getMBeanInfo(new ObjectName("jboss:service=Mail"));
  4. for(MBeanAttributeInfo info : infos) {
  5.     if(info.getName().equals("State")) {
  6.         if(info.isWritable()) {
  7.             //do something
  8.         }
  9.         break;
  10.     }
  11. }