java - What is the difference between a standard MBean and dynamic MBean? -


what different between:

  1. standard mbeans
  2. dynamic mbeans

what pros , cons of each , when should choose either of these 2 components manage resource?

a standard mbean has fixed meta-data not change during lifetime of mbean. dynamic mbeans define meta-data on fly , can modify , re-publish meta-data. think [badly] contrived analogy java: let's wrote class listed number of files in directory. standard class method might like:

public int getfilecount(string directoryname)

on other hand, dynamic mbean version of class start no methods, when starts up, scans directories available, , creates new method each directory found:

public int getfilecountdir1(); public int getfilecountdir2(); .... public int getfilecountdirn(); 

so that's not useful setup, suppose wanted create mbean displayed jvm's system properties. well.... system properties change... , there's no reasonable way of knowing property keys defined ahead of time, better representation of dynamic mbean for.

the pros , cons come down to:

  1. standard mbeans easy create, , existing class instances can wrapped , exposed standard mbeans.
  2. dynamic mbeans cool when serve useful purpose, measurably more effort implement.

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -