Source Code Cross Referenced for ModelMBeanConstructorInfo.java in  » JMX » XMOJO » javax » management » modelmbean » 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 » XMOJO » javax.management.modelmbean 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * The XMOJO Project 5
003:         * Copyright © 2003 XMOJO.org. All rights reserved.
004:
005:         * NO WARRANTY
006:
007:         * BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
008:         * THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
009:         * OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
010:         * PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
011:         * OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
012:         * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
013:         * TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE
014:         * LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
015:         * REPAIR OR CORRECTION.
016:
017:         * IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
018:         * ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
019:         * THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
020:         * GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
021:         * USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF
022:         * DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
023:         * PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE),
024:         * EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
025:         * SUCH DAMAGES.
026:         **/package javax.management.modelmbean;
027:
028:        import java.lang.reflect.Constructor;
029:        import java.io.ObjectInputStream;
030:        import java.io.ObjectOutputStream;
031:        import java.io.ObjectStreamField;
032:        import java.io.IOException;
033:
034:        import javax.management.Descriptor;
035:        import javax.management.DescriptorAccess;
036:        import javax.management.MBeanConstructorInfo;
037:        import javax.management.MBeanParameterInfo;
038:        import javax.management.IntrospectionException;
039:
040:        /**
041:         * The ModelMBeanConstructorInfo object describes a constructor of the
042:         * ModelMBean. It is a subclass of MBeanConstructorInfo with the addition
043:         * of an associated Descriptor and an implementation of the DescriptorAccess
044:         * interface.
045:         * <p>
046:         * <p>
047:         * <PRE>
048:         * The fields in the descriptor are defined, but not limited to, the following: <P>
049:         *	name           : operation name
050:         *	descriptorType : must be "operation"
051:         *	role           : must be "constructor"
052:         *	displayName    : human readable name of constructor
053:         *	class          : class where method is defined (fully qualified)
054:         *	visibility            : 1-4 where 1: always visible 4: rarely visible
055:         *	presentationString :  xml formatted string to describe how to present operation
056:         *</PRE>
057:         * <p>PersistencePolicy and CurrencyTimeLimit fields are not valid for the
058:         * constructor. The default constructo will have the name, descriptorType,
059:         * and role fields.
060:         */
061:        public class ModelMBeanConstructorInfo extends MBeanConstructorInfo
062:                implements  DescriptorAccess, Cloneable {
063:            Descriptor descriptor = new DescriptorSupport();
064:
065:            private static final long serialVersionUID = 2675397548836767216L;
066:
067:            private static final ObjectStreamField[] serialPersistentFields = {
068:                    new ObjectStreamField("consDescriptor",
069:                            DescriptorSupport.class),
070:                    new ObjectStreamField("currClass", java.lang.String.class) };
071:
072:            /**
073:             * Constructs a MBeanConstructorInfo object with a default descriptor.
074:             *
075:             * @param description The description of the constructor
076:             *
077:             * @param constructor object describing the MBean constructor.
078:             */
079:            public ModelMBeanConstructorInfo(String description,
080:                    Constructor constructor) {
081:                super (description, constructor);
082:            }
083:
084:            /**
085:             * Constructs a MBeanConstructorInfo object with the specified  descriptor.
086:             *
087:             * @param description The description of the constructor
088:             *
089:             * @param constructor object describing the MBean constructor.
090:             *
091:             * @param descriptor  An instance of Descriptor containing the appropriate
092:             * 				metadata for this instance of the ModelMBeanConstructorInfo.
093:             * 				If it is null or invalid then a default desriptor will be created.
094:             */
095:            public ModelMBeanConstructorInfo(String description,
096:                    Constructor constructor, Descriptor descriptor) {
097:                super (description, constructor);
098:                this .descriptor = descriptor;
099:            }
100:
101:            /**
102:             * Constructs a MBeanConstructorInfo object with a default descriptor.
103:             *
104:             * @param name The name of the constructor
105:             *
106:             * @param description The description of the constructor
107:             *
108:             * @param signature  MBeanParameterInfo object array describing the
109:             * 				parameters of the constructor.
110:             */
111:            public ModelMBeanConstructorInfo(String name, String description,
112:                    MBeanParameterInfo[] signature) {
113:                super (name, description, signature);
114:            }
115:
116:            /**
117:             * Constructs a MBeanConstructorInfo object with a default descriptor.
118:             *
119:             * @param name The name of the constructor
120:             *
121:             * @param description The description of the constructor
122:             *
123:             * @param signature MBeanParameterInfo object array describing the
124:             * 				parameters of the constructor.
125:             *
126:             * @param descriptor An instance of Descriptor containing the appropriate
127:             * 				metadata for this instance of the ModelMBeanConstructorInfo.
128:             * 				If it is null or invalid then a default desriptor will be created.
129:             */
130:            public ModelMBeanConstructorInfo(String name, String description,
131:                    MBeanParameterInfo[] signature, Descriptor descriptor) {
132:                super (name, description, signature);
133:                this .descriptor = descriptor;
134:            }
135:
136:            /**
137:             * Constructs a duplicate copy ModelMBeanConstructorInfo.
138:             * @return The duplicate copy of the object is returned.
139:             */
140:            public Object clone() {
141:                Descriptor clonedDescr = null;
142:
143:                if (descriptor != null)
144:                    clonedDescr = (Descriptor) descriptor.clone();
145:
146:                return new ModelMBeanConstructorInfo(getName(),
147:                        getDescription(), getSignature(), clonedDescr);
148:            }
149:
150:            /**
151:             * Returns the descriptor
152:             *
153:             * @return Descriptor associated with the ModelMBeanConstructorInfo object.
154:             */
155:            public Descriptor getDescriptor() {
156:                return descriptor;
157:            }
158:
159:            /**
160:             * Sets associated Descriptor of ModelMBeanConstructorInfo. If the new
161:             * Descriptor is null, then the associated Descriptor reverts to a default
162:             * descriptor. The Descriptor is validated before it is assigned. If the
163:             * new Descriptor is invalid, then an IllegalArgumentException is thrown.
164:             *
165:             * @param inDescriptor replaces the Descriptor associated with
166:             * 				the ModelMBeanConstructor.
167:             *
168:             * @throws IllegalArgumentException If the argument passsed in is illegal
169:             * 				then this Exception will be thrown
170:             */
171:            public void setDescriptor(Descriptor inDescriptor) {
172:                this .descriptor = inDescriptor;
173:            }
174:
175:            /**
176:             * Returns a human readable version of the ModelMBeanConstructorInfo instance
177:             */
178:            public String toString() {
179:                if (descriptor != null)
180:                    return (super .toString() + "\n Descriptor = " + descriptor
181:                            .toString());
182:                else
183:                    return (super .toString() + "\n Descriptor = null");
184:            }
185:
186:            //--------------------------- Private methods ---------------------------//
187:
188:            private void readObject(ObjectInputStream objectinputstream)
189:                    throws IOException, ClassNotFoundException {
190:                ObjectInputStream.GetField getfield = objectinputstream
191:                        .readFields();
192:
193:                try {
194:                    descriptor = (DescriptorSupport) getfield.get(
195:                            "consDescriptor", null);
196:                } catch (Exception exception) {
197:                }
198:            }
199:
200:            private void writeObject(ObjectOutputStream objectoutputstream)
201:                    throws IOException {
202:                ObjectOutputStream.PutField putfield = objectoutputstream
203:                        .putFields();
204:                putfield.put("consDescriptor", descriptor);
205:                putfield.put("currClass", "ModelMBeanConstructorInfo");
206:
207:                objectoutputstream.writeFields();
208:            }
209:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.