Source Code Cross Referenced for SimpleRelation.java in  » JMX » jfoxmx » example » jmx » relation » 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 » example.jmx.relation 
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 example.jmx.relation;
009:
010:        import javax.management.relation.RelationSupport;
011:        import javax.management.relation.RoleList;
012:        import javax.management.relation.InvalidRoleValueException;
013:        import javax.management.ObjectName;
014:
015:        /**
016:         * 
017:         * @author <a href="mailto:young_yy@hotmail.org">Young Yang</a>
018:         */
019:
020:        /**
021:         * Simple definition of a standard MBean, named "SimpleRelation".
022:         *
023:         * The "SimpleRelation" standard MBean shows how to define a relation MBean,
024:         * i.e. expected to represent a relation but also including attributes and
025:         * operations for management by implementing its corresponding
026:         * "SimpleRelationMBean" management interface.
027:         *
028:         * This MBean has two attributes and one operation exposed
029:         * for management by a JMX agent:
030:         *      - the read/write "State" attribute,
031:         *      - the read only "NbChanges" attribute,
032:         *	- the "reset()" operation.
033:         *
034:         * This object also has one property and one method not exposed
035:         * for management by a JMX agent:
036:         *	- the "NbResets" property,
037:         *	- the "getNbResets()" method.
038:         *
039:         * It extends the RelationSupport class to retrieve the implementation of the
040:         * Relation interface.
041:         */
042:
043:        public class SimpleRelation extends RelationSupport implements 
044:                SimpleRelationMBean {
045:
046:            /*
047:             * -----------------------------------------------------
048:             * ATTRIBUTES ACCESSIBLE FOR MANAGEMENT BY A JMX AGENT
049:             * -----------------------------------------------------
050:             */
051:
052:            private String state = "initial state";
053:            private int nbChanges = 0;
054:
055:            /*
056:             * -----------------------------------------------------
057:             * PROPERTY NOT ACCESSIBLE FOR MANAGEMENT BY A JMX AGENT
058:             * -----------------------------------------------------
059:             */
060:
061:            private int nbResets = 0;
062:
063:            /*
064:             * -----------------------------------------------------
065:             * CONSTRUCTORS
066:             * -----------------------------------------------------
067:             */
068:
069:            public SimpleRelation(String theRelId,
070:                    ObjectName theRelServiceName, String theRelTypeName,
071:                    RoleList theRoleList) throws InvalidRoleValueException,
072:                    IllegalArgumentException {
073:
074:                super (theRelId, theRelServiceName, theRelTypeName, theRoleList);
075:            }
076:
077:            /*
078:             * -----------------------------------------------------
079:             * IMPLEMENTATION OF THE SimpleRelationMBean INTERFACE
080:             * -----------------------------------------------------
081:             */
082:
083:            /**
084:             * Getter: get the "State" attribute of the "SimpleRelation" standard MBean.
085:             *
086:             * @return the current value of the "State" attribute.
087:             */
088:            public String getState() {
089:                return state;
090:            }
091:
092:            /**
093:             * Setter: set the "State" attribute of the "SimpleRelation" standard MBean.
094:             *
095:             */
096:            public void setState(String s) {
097:                state = s;
098:                nbChanges++;
099:            }
100:
101:            /**
102:             * Getter: get the "NbChanges" attribute of the "SimpleRelation" standard MBean.
103:             *
104:             * @return the current value of the "NbChanges" attribute.
105:             */
106:            public Integer getNbChanges() {
107:                return new Integer(nbChanges);
108:            }
109:
110:            /**
111:             * Operation: reset to their initial values the "State" and "NbChanges"
112:             * attributes of the "SimpleRelation" standard MBean.
113:             */
114:            public void reset() {
115:                state = "initial state";
116:                nbChanges = 0;
117:                nbResets++;
118:            }
119:
120:            /*
121:             * -----------------------------------------------------
122:             * METHOD NOT EXPOSED FOR MANAGEMENT BY A JMX AGENT
123:             * -----------------------------------------------------
124:             */
125:
126:            /**
127:             * Return the "NbResets" property.
128:             * This method is not a Getter in the JMX sense because
129:             * it is not exposed in the "SimpleRelationMBean" interface.
130:             *
131:             * @return the current value of the "NbResets" property.
132:             */
133:            public Integer getNbResets() {
134:                return new Integer(nbResets);
135:            }
136:
137:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.