Source Code Cross Referenced for ObjectInstance.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.io.Serializable;
011:
012:        /**
013:         *
014:         * @author <a href="mailto:young_yy@hotmail.org">Young Yang</a>
015:         */
016:
017:        /**
018:         * Used to represent the object name of an MBean and its class name.
019:         * If the MBean is a Dynamic MBean the class name should be retrieved from the <CODE>MBeanInfo</CODE> it provides.
020:         */
021:        public class ObjectInstance implements  Serializable {
022:
023:            /**
024:             * Object name.
025:             */
026:            private ObjectName name;
027:
028:            /**
029:             * Class name.
030:             */
031:            private String className;
032:
033:            /**
034:             * Allows an object instance to be created given a string representation of
035:             * an object name and the full class name, including the package name.
036:             *
037:             * @param objectName  A string representation of the object name.
038:             * @param className  The full class name, including the package name, of the object instance.
039:             * If the MBean is a Dynamic MBean the class name should be retrieved from the <CODE>MBeanInfo</CODE> it provides.
040:             *
041:             * @exception MalformedObjectNameException The string passed as a parameter does not have the right format.
042:             *
043:             */
044:            public ObjectInstance(String objectName, String className)
045:                    throws MalformedObjectNameException {
046:                ObjectName objName = new ObjectName(objectName);
047:
048:                if (objName.isPattern()) {
049:                    new RuntimeOperationsException(
050:                            new IllegalArgumentException("Invalid name: "
051:                                    + objName.toString()));
052:                }
053:                this .name = objName;
054:                this .className = className;
055:            }
056:
057:            /**
058:             * Allows an object instance to be created given an object name and
059:             * the full class name, including the package name.
060:             *
061:             * @param objectName  The object name.
062:             * @param className  The full class name, including the package name, of the object instance.
063:             * If the MBean is a Dynamic MBean the class name should be retrieved from the <CODE>MBeanInfo</CODE> it provides.
064:             *
065:             */
066:            public ObjectInstance(ObjectName objectName, String className) {
067:                if (objectName.isPattern()) {
068:                    new RuntimeOperationsException(
069:                            new IllegalArgumentException("Invalid name: "
070:                                    + objectName.toString()));
071:                }
072:                this .name = objectName;
073:                this .className = className;
074:            }
075:
076:            /**
077:             * Compares the current object instance with another object instance.
078:             *
079:             * @param object  The object instance that the current object instance is to be compared
080:             * with.
081:             *
082:             * @return  True if the two object instances are equal, otherwise false.
083:             */
084:            public boolean equals(Object object) {
085:                if (!(object instanceof  ObjectInstance)) {
086:                    return false;
087:                }
088:                ObjectInstance val = (ObjectInstance) object;
089:                return ((name.equals(val.getObjectName())) && (className
090:                        .equals(val.getClassName())));
091:            }
092:
093:            /**
094:             * Returns the object name part.
095:             */
096:            public ObjectName getObjectName() {
097:                return name;
098:            }
099:
100:            /**
101:             * Returns the class part
102:             */
103:            public String getClassName() {
104:                return className;
105:            }
106:
107:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.