The Javadoc for MBeanRegistration.preRegister says
"Throws:
Exception - This exception will be caught by the MBean server and re-thrown as an MBeanRegistrationException or a RuntimeMBeanException."
It doesn't say when it will be one or the other. Furthermore, MBeanServer.createMBean doesn't declare that it can throw RuntimeMBeanException, even though it does declare RuntimeOperationsException (which is also a RuntimeException). The RI always wraps in MBeanRegistrationException, even when the original exception is a RuntimeException. The TCK tests for this behaviour. Thus, it would make sense for the spec to say that the exception is always wrapped in MBeanRegistrationException, and no longer mention RuntimeMBeanException in the doc for MBeanRegistration.preRegister.
The PDF spec is unambiguous on the subject. P123 says:
"This method might throw the MBeanRegistrationException that will be thrown again unchanged by the MBean server. Any other exception will be caught by the MBean server, encapsulated in an MBeanRegistrationException and thrown again."
"Throws:
Exception - This exception will be caught by the MBean server and re-thrown as an MBeanRegistrationException or a RuntimeMBeanException."
It doesn't say when it will be one or the other. Furthermore, MBeanServer.createMBean doesn't declare that it can throw RuntimeMBeanException, even though it does declare RuntimeOperationsException (which is also a RuntimeException). The RI always wraps in MBeanRegistrationException, even when the original exception is a RuntimeException. The TCK tests for this behaviour. Thus, it would make sense for the spec to say that the exception is always wrapped in MBeanRegistrationException, and no longer mention RuntimeMBeanException in the doc for MBeanRegistration.preRegister.
The PDF spec is unambiguous on the subject. P123 says:
"This method might throw the MBeanRegistrationException that will be thrown again unchanged by the MBean server. Any other exception will be caught by the MBean server, encapsulated in an MBeanRegistrationException and thrown again."