KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > server > core > mbean > test > EasyConfigTestMBean


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * EasyConfigTestMBean.java
26  *
27  * Created on December 14, 2001, 8:10 PM
28  */

29
30 package com.sun.enterprise.admin.server.core.mbean.test;
31
32 //Admin imports
33
import com.sun.enterprise.admin.server.core.mbean.config.AdminBase;
34 import com.sun.enterprise.admin.server.core.mbean.meta.*;
35
36 import javax.management.*;
37 import com.sun.enterprise.admin.util.*;
38
39 /**
40  *
41  * @author alexkrav
42  * @version
43  */

44 public class EasyConfigTestMBean extends AdminBase
45 {
46     public String JavaDoc[] attrs = {"color, java.lang.String, RW, Color of bean",
47                              "size, java.lang.String[], RW, Size of bean(array)",
48                              "testInt, int, R, Test int value",
49                              "testInt3DSArray, int[][][], R, Test int3DArray value",
50                              "testInfoArr, javax.management.MBeanAttributeInfo[], R, Test info[] value"} ;
51     public String JavaDoc[] opers = {"setColor(java.lang.String clr Description for string color), ACTION, Test method(setColor)",
52                              "emptyParamMethod(), INFO, Test empty param-list methodemptyParamMethod",
53                              "testComplexMethod("+
54                                       "int intValue Description for intValue ,"+
55                                       "int[] intArrayValue Description for intArrayValue,"+
56                                       "java.lang.String[][][] str3DArray Description for str3DArray), ACTION_INFO, Test method(testComplexMethod)"
57                              };
58
59                                       
60     public String JavaDoc Smell = null;
61     public String JavaDoc Taste = null;
62
63     /**
64         Creates new EasyConfigTestMBean
65     */

66     
67     public EasyConfigTestMBean ()
68     {
69   }
70     
71     public EasyConfigTestMBean(String JavaDoc msg)
72     {
73     }
74     
75     public EasyConfigTestMBean(String JavaDoc[] msgs, int testCode)
76     {
77     }
78
79     public MBeanInfo getMBeanInfo()
80     {
81        try {
82          return (new MBeanEasyConfig(getClass(), attrs, opers, "TEST BEAN")).getMBeanInfo();
83        } catch(Exception JavaDoc e)
84        {
85          System.out.println("++++++++++++++++++++E X C E P T I O N+++++++++++++++++++++++++ getMBeanInfo():Exception:"+e);
86          e.printStackTrace();
87          return null;
88        }
89        
90     }
91     public String JavaDoc getColor()
92     {
93         return "test";
94     }
95     public void setColor(String JavaDoc c)
96     {
97     }
98     public String JavaDoc getSmell()
99     {
100         return "test";
101     }
102
103     public boolean testComplexMethod(int intValue, int[] intValue2, String JavaDoc[][][] str)
104     {
105         return false;
106     }
107
108     public void emptyParamMethod()
109     {
110     }
111     /** Every resource MBean should override this method to execute specific
112      * operations on the MBean. This method is enhanced in 8.0. It was a no-op
113      * in 7.0. In 8.0, it is modified to invoke the actual method through
114      * reflection.
115      * @since 8.0
116      * @see javax.management.MBeanServer#invoke
117      * @see #getImplementingClass
118      */

119     protected Class JavaDoc getImplementingClass() {
120         return ( this.getClass() );
121     }
122     
123     /** Reflection requires the implementing object.
124      * @since 8.0
125     */

126     protected Object JavaDoc getImplementingMBean() {
127         return ( this );
128     }
129
130 }
131
Popular Tags