KickJava   Java API By Example, From Geeks To Geeks.

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


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  * ManagedTest.java
26  *
27  * Created on December 4, 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.util.*;
35
36 /**
37  *
38  * @author kedar
39  * @version
40  */

41 public class ManagedTest extends AdminBase
42 {
43     public String JavaDoc Color = null;
44     public String JavaDoc Smell = null;
45     public String JavaDoc Taste = null;
46
47     /**
48         Creates new ManagedTest
49     */

50     
51     public ManagedTest ()
52     {
53         Color = "BLUE";
54         Smell = "PLEASANT";
55         Taste = "SWEET";
56     }
57     
58     public ManagedTest(String JavaDoc msg)
59     {
60     }
61     
62     public String JavaDoc getColor()
63     {
64         return Color;
65     }
66     public void setColor(String JavaDoc c)
67     {
68         Color = c;
69     }
70     public String JavaDoc getSmell()
71     {
72         return Smell;
73     }
74     public void setSmell(String JavaDoc s)
75     {
76         Smell = s;
77     }
78     public String JavaDoc getTaste()
79     {
80         return Taste;
81     }
82     public void setTaste(String JavaDoc t)
83     {
84         Taste = t;
85     }
86     public void voidVoid()
87     {
88         Logger.log("Method: takes void returns void");
89     }
90     public String JavaDoc stringVoid()
91     {
92         Logger.log("Method: takes void returns string");
93         return ("stringvoid");
94     }
95     public void voidInt(int i)
96     {
97         Logger.log("Method: takes int = " + i + " and returns void");
98     }
99     /** Every resource MBean should override this method to execute specific
100      * operations on the MBean. This method is enhanced in 8.0. It was a no-op
101      * in 7.0. In 8.0, it is modified to invoke the actual method through
102      * reflection.
103      * @since 8.0
104      * @see javax.management.MBeanServer#invoke
105      * @see #getImplementingClass
106      */

107     protected Class JavaDoc getImplementingClass() {
108         return ( this.getClass() );
109     }
110     
111     /** Reflection requires the implementing object.
112      * @since 8.0
113     */

114     protected Object JavaDoc getImplementingMBean() {
115         return ( this );
116     }
117     
118 }
119
Popular Tags