9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 6448042
27 * @summary Test that MXBeans can define their own names in preRegister
28 * @author Eamonn McManus
29 * @modules java.management
30 */
31
32 import java.lang.management.ManagementFactory;
33 import java.lang.reflect.Constructor;
34 import javax.management.MBeanRegistration;
35 import javax.management.MBeanServer;
36 import javax.management.ObjectInstance;
37 import javax.management.ObjectName;
38 import javax.management.StandardMBean;
39
40 /*
41 * Test that an MXBean can decide its name by returning a value from
42 * the preRegister method. Also test the same thing for Standard MBeans
43 * for good measure.
44 */
45 public class PreRegisterNameTest {
46 public static interface SpumeMXBean {}
47
48 public static class Spume implements SpumeMXBean, MBeanRegistration {
49 private ObjectName realName;
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 6448042
27 * @summary Test that MXBeans can define their own names in preRegister
28 * @author Eamonn McManus
29 */
30
31 import java.lang.management.ManagementFactory;
32 import java.lang.reflect.Constructor;
33 import javax.management.MBeanRegistration;
34 import javax.management.MBeanServer;
35 import javax.management.ObjectInstance;
36 import javax.management.ObjectName;
37 import javax.management.StandardMBean;
38
39 /*
40 * Test that an MXBean can decide its name by returning a value from
41 * the preRegister method. Also test the same thing for Standard MBeans
42 * for good measure.
43 */
44 public class PreRegisterNameTest {
45 public static interface SpumeMXBean {}
46
47 public static class Spume implements SpumeMXBean, MBeanRegistration {
48 private ObjectName realName;
|