KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > system > controller > support > BrokenDynamicMBeanAttributes


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2006, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.test.system.controller.support;
23
24 import javax.management.Attribute JavaDoc;
25 import javax.management.AttributeList JavaDoc;
26 import javax.management.AttributeNotFoundException JavaDoc;
27 import javax.management.DynamicMBean JavaDoc;
28 import javax.management.InvalidAttributeValueException JavaDoc;
29 import javax.management.MBeanAttributeInfo JavaDoc;
30 import javax.management.MBeanException JavaDoc;
31 import javax.management.MBeanInfo JavaDoc;
32 import javax.management.ObjectName JavaDoc;
33 import javax.management.ReflectionException JavaDoc;
34
35 import org.jboss.mx.util.ObjectNameFactory;
36 import org.jboss.util.NotImplementedException;
37
38 /**
39  * BrokenDynamicMBean.
40  *
41  * @author <a HREF="adrian@jboss.com">Adrian Brock</a>
42  * @version $Revision: 1.1 $
43  */

44 public class BrokenDynamicMBeanAttributes implements DynamicMBean JavaDoc
45 {
46    public static final ObjectName JavaDoc OBJECT_NAME = ObjectNameFactory.create("jboss.test:type=BrokenDynamicMBeanAttributes");
47    
48    public MBeanInfo JavaDoc getMBeanInfo()
49    {
50       return new BrokenMBeanInfoAttributes();
51    }
52
53    public Object JavaDoc getAttribute(String JavaDoc attribute) throws AttributeNotFoundException JavaDoc, MBeanException JavaDoc, ReflectionException JavaDoc
54    {
55       throw new org.jboss.util.NotImplementedException("getAttribute");
56    }
57
58    public AttributeList JavaDoc getAttributes(String JavaDoc[] attributes)
59    {
60       throw new NotImplementedException("getAttributes");
61    }
62
63    public Object JavaDoc invoke(String JavaDoc actionName, Object JavaDoc[] params, String JavaDoc[] signature) throws MBeanException JavaDoc, ReflectionException JavaDoc
64    {
65       throw new NotImplementedException("invoke");
66    }
67
68    public void setAttribute(Attribute JavaDoc attribute) throws AttributeNotFoundException JavaDoc, InvalidAttributeValueException JavaDoc, MBeanException JavaDoc, ReflectionException JavaDoc
69    {
70       throw new NotImplementedException("setAttribute");
71    }
72
73    public AttributeList JavaDoc setAttributes(AttributeList JavaDoc attributes)
74    {
75       throw new NotImplementedException("setAttributes");
76    }
77    
78    private static class BrokenMBeanInfoAttributes extends MBeanInfo JavaDoc
79    {
80       private static final long serialVersionUID = 1158114004365977632L;
81
82       public BrokenMBeanInfoAttributes() throws IllegalArgumentException JavaDoc
83       {
84          super(BrokenDynamicMBeanAttributes.class.getName(), "Broken", null, null, null, null);
85       }
86
87       public MBeanAttributeInfo JavaDoc[] getAttributes()
88       {
89          throw new Error JavaDoc("BROKEN");
90       }
91    }
92 }
93
Popular Tags