My proposal is to specify in EE 7 that MBeanServer injection should be able in a container environment.
The reason for this proposal is, that some AS provide it's own platform specific MBeanServer, so that ManagementFactory.getPlatformMBeanServer() will not provide the correct MBeanServer.
To build platform independent components, the container should provide the correct MBeanServer via @Resource or @Inject.
With this, one for example can implement an interceptor with @AroundConstruct to do the registration of a MXBean in a container environment.
This would pass the rule of separating concerns and will get a clear EJB Pojo as well.
So with @Resource injection, this will work even on appservers with its own MBeanServer, not only with JVM PlatformServer, but the developer do not care about this.
Next, @Resource injection could be used also in a normal EJB to do some client work (observe notifications, get attributes aso.) with a registered mbean without the need to distinguish about the right MBeanServer to be used.