01: /*
02: * Copyright (C) The MX4J Contributors.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the MX4J License version 1.0.
06: * See the terms of the MX4J License in the documentation provided with this software.
07: */
08:
09: package test.javax.management.support;
10:
11: import javax.management.Attribute;
12: import javax.management.AttributeList;
13: import javax.management.AttributeNotFoundException;
14: import javax.management.DynamicMBean;
15: import javax.management.InvalidAttributeValueException;
16: import javax.management.MBeanAttributeInfo;
17: import javax.management.MBeanConstructorInfo;
18: import javax.management.MBeanException;
19: import javax.management.MBeanInfo;
20: import javax.management.MBeanNotificationInfo;
21: import javax.management.MBeanOperationInfo;
22: import javax.management.MBeanRegistration;
23: import javax.management.MBeanServer;
24: import javax.management.ObjectName;
25: import javax.management.ReflectionException;
26:
27: /**
28: * @version $Revision: 1.4 $
29: */
30: public class NullMBeanInfoDMB implements DynamicMBean,
31: MBeanRegistration {
32: private boolean registered;
33:
34: public MBeanInfo getMBeanInfo() {
35: return (registered) ? null
36: : new MBeanInfo(
37: "test.javax.management.support.NullMBeanInfoDMB",
38: "A DynamicMBean that returns null in response to getMBeanInfo() invocations",
39: new MBeanAttributeInfo[0],
40: new MBeanConstructorInfo[0],
41: new MBeanOperationInfo[0],
42: new MBeanNotificationInfo[0]);
43: }
44:
45: public Object getAttribute(String attribute)
46: throws AttributeNotFoundException, MBeanException,
47: ReflectionException {
48: return null;
49: }
50:
51: public void setAttribute(Attribute attribute)
52: throws AttributeNotFoundException,
53: InvalidAttributeValueException, MBeanException,
54: ReflectionException {
55: }
56:
57: public AttributeList getAttributes(String[] attributes) {
58: return null;
59: }
60:
61: public AttributeList setAttributes(AttributeList attributes) {
62: return null;
63: }
64:
65: public Object invoke(String method, Object[] arguments,
66: String[] params) throws MBeanException, ReflectionException {
67: return null;
68: }
69:
70: public void postDeregister() {
71: }
72:
73: public void postRegister(Boolean registrationDone) {
74: registered = registrationDone.booleanValue();
75: }
76:
77: public void preDeregister() throws Exception {
78: }
79:
80: public ObjectName preRegister(MBeanServer server, ObjectName name)
81: throws Exception {
82: return name;
83: }
84:
85: }
|