Both are possible, although I think more common is the case of the mbean acting as a wrapper over the real resource (i.e. the resource doesn't know about mbeans).
manage/monitor running applications in that JVM using JMX.
1. it works same as junit but it works running mode
2. change configuration in run time
3. get and set data into bean class in run time .