Source Code Cross Referenced for MBeanOperationInfo.java in  » JMX » jfoxmx » javax » management » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » JMX » jfoxmx » javax.management 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* JFox, the OpenSource J2EE Application Server
002:         *
003:         * Copyright (C) 2002 huihoo.org
004:         * Distributable under GNU LGPL license
005:         * See the GNU Lesser General Public License for more details.
006:         */
007:
008:        package javax.management;
009:
010:        import java.lang.reflect.Method;
011:        import java.io.Serializable;
012:
013:        /**
014:         * Describes a management operation exposed by an MBean.
015:         *
016:         * @author <a href="mailto:young_yy@hotmail.org">Young Yang</a>
017:         */
018:
019:        public class MBeanOperationInfo extends MBeanFeatureInfo implements 
020:                Serializable, Cloneable {
021:            /**
022:             * Indicates that the operation is read-like,
023:             * it basically returns information.
024:             */
025:            public static final int INFO = 0;
026:
027:            /**
028:             * Indicates that the operation is a write-like,
029:             * and would modify the MBean in some way, typically by writing some value
030:             * or changing a configuration.
031:             */
032:            public static final int ACTION = 1;
033:
034:            /**
035:             * Indicates that the operation is a read/write-like.
036:             */
037:            public static final int ACTION_INFO = 2;
038:
039:            /**
040:             * Indicates that the operation has an "unknown" nature.
041:             */
042:            public static final int UNKNOWN = 3;
043:
044:            /**
045:             * The method's return value.
046:             */
047:            private String type = null;
048:
049:            /**
050:             * The signature of the method, that is, the class names of the arguments.
051:             */
052:            private MBeanParameterInfo[] signature = null;
053:
054:            /**
055:             * Returns the impact of the method, one of
056:             * <CODE>INFO</CODE>, <CODE>ACTION</CODE>, <CODE>ACTION_INFO</CODE>, <CODE>UNKNOWN</CODE>.
057:             */
058:            private int impact = MBeanOperationInfo.UNKNOWN;
059:
060:            /**
061:             * Constructs an <CODE>MBeanOperationInfo</CODE> object.
062:             *
063:             * @param method The <CODE>java.lang.reflect.Method</CODE> object describing the MBean operation.
064:             * @param description A human readable description of the operation.
065:             */
066:            public MBeanOperationInfo(String description, Method method) {
067:                super (method.getName(), description);
068:                findMethodReturnType(method);
069:                findMethodParameterTypes(method);
070:            }
071:
072:            /**
073:             * Constructs an <CODE>MBeanOperationInfo</CODE> object.
074:             *
075:             * @param name The name of the method.
076:             * @param description A human readable description of the operation.
077:             * @param signature <CODE>MBeanParameterInfo</CODE> objects describing the parameters(arguments) of the method.
078:             * @param type The type of the method'name return value.
079:             * @param impact The impact of the method, one of <CODE>INFO, ACTION, ACTION_INFO, UNKNOWN</CODE>.
080:             */
081:            public MBeanOperationInfo(String name, String description,
082:                    MBeanParameterInfo[] signature, String type, int impact) {
083:                super (name, description);
084:                this .signature = signature;
085:                this .type = type;
086:                this .impact = impact;
087:            }
088:
089:            public Object clone() {
090:                try {
091:                    return super .clone();
092:                } catch (CloneNotSupportedException clonenotsupportedexception) {
093:                    return null;
094:                }
095:            }
096:
097:            /**
098:             * Returns the description of the method's return value.
099:             */
100:            public String getReturnType() {
101:                return type;
102:            }
103:
104:            /**
105:             * Returns the signature of the method, that is, information on the operation's arguments.
106:             */
107:            public MBeanParameterInfo[] getSignature() {
108:                if (signature != null) {
109:                    int len = signature.length;
110:                    MBeanParameterInfo[] paramsInfo = new MBeanParameterInfo[len];
111:                    for (int i = 0; i < len; i++) {
112:                        paramsInfo[i] = (MBeanParameterInfo) (signature[i])
113:                                .clone();
114:                    }
115:                    return paramsInfo;
116:                } else {
117:                    return new MBeanParameterInfo[0];
118:                }
119:            }
120:
121:            /**
122:             * Returns the impact of the method, one of
123:             * <CODE>INFO</CODE>, <CODE>ACTION</CODE>, <CODE>ACTION_INFO</CODE>, <CODE>UNKNOWN</CODE>.
124:             */
125:            public int getImpact() {
126:                return impact;
127:            }
128:
129:            /**
130:             * Sets the action signature and parameters.
131:             * <P>
132:             */
133:            private void findMethodParameterTypes(Method method) {
134:                String[] sigs = findSignatures(method.getParameterTypes());
135:                if (sigs != null) {
136:                    int len = sigs.length;
137:                    signature = new MBeanParameterInfo[len];
138:                    for (int i = 0; i < len; i++) {
139:                        signature[i] = new MBeanParameterInfo("", sigs[i], "");
140:                    }
141:                }
142:            }
143:
144:            /**
145:             * Converts the array of classes to an array of class signatures.
146:             */
147:            private String[] findSignatures(Class[] clz) {
148:                String signers[] = new String[clz.length];
149:                for (int i = 0; i < clz.length; i++) {
150:                    signers[i] = clz[i].getName();
151:                }
152:                return signers;
153:            }
154:
155:            private void findMethodReturnType(Method method) {
156:                type = method.getReturnType().getName();
157:            }
158:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.