Source Code Cross Referenced for AbstractStandardMBean.java in  » Database-JDBC-Connection-Pool » sequoia-2.10.9 » org » continuent » sequoia » controller » jmx » 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 » Database JDBC Connection Pool » sequoia 2.10.9 » org.continuent.sequoia.controller.jmx 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Sequoia: Database clustering technology.
003:         * Copyright (C) 2002-2004 French National Institute For Research In Computer
004:         * Science And Control (INRIA).
005:         * Contact: sequoia@continuent.org
006:         * 
007:         * Licensed under the Apache License, Version 2.0 (the "License");
008:         * you may not use this file except in compliance with the License.
009:         * You may obtain a copy of the License at
010:         * 
011:         * http://www.apache.org/licenses/LICENSE-2.0
012:         * 
013:         * Unless required by applicable law or agreed to in writing, software
014:         * distributed under the License is distributed on an "AS IS" BASIS,
015:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016:         * See the License for the specific language governing permissions and
017:         * limitations under the License. 
018:         *
019:         * Initial developer(s): Marc Wick.
020:         * Contributor(s): ______________________.
021:         */package org.continuent.sequoia.controller.jmx;
022:
023:        import javax.management.ListenerNotFoundException;
024:        import javax.management.MBeanAttributeInfo;
025:        import javax.management.MBeanConstructorInfo;
026:        import javax.management.MBeanInfo;
027:        import javax.management.MBeanNotificationInfo;
028:        import javax.management.MBeanOperationInfo;
029:        import javax.management.MBeanParameterInfo;
030:        import javax.management.NotCompliantMBeanException;
031:        import javax.management.Notification;
032:        import javax.management.NotificationBroadcasterSupport;
033:        import javax.management.NotificationEmitter;
034:        import javax.management.NotificationFilter;
035:        import javax.management.NotificationListener;
036:        import javax.management.StandardMBean;
037:
038:        import org.continuent.sequoia.common.i18n.JmxTranslate;
039:
040:        /**
041:         * This class defines a AbstractStandardMBean
042:         * 
043:         * @author <a href="mailto:marc.wick@monte-bre.ch">Marc Wick </a>
044:         * @version 1.0
045:         */
046:        public abstract class AbstractStandardMBean extends StandardMBean
047:                implements  NotificationEmitter {
048:            /**
049:             * the broadcaster instance we write a wrapper for
050:             */
051:            private transient NotificationBroadcasterSupport broadcaster;
052:
053:            /**
054:             * Creates a new <code>AbstractStandardMBean.java</code> object
055:             * 
056:             * @param mbeanInterface The Management Interface exported by this MBean.
057:             * @throws NotCompliantMBeanException - if the mbeanInterface does not follow
058:             *           JMX design patterns for Management Interfaces, or if this does
059:             *           not implement the specified interface.
060:             */
061:            public AbstractStandardMBean(Class mbeanInterface)
062:                    throws NotCompliantMBeanException {
063:                super (mbeanInterface);
064:                broadcaster = new NotificationBroadcasterSupport();
065:            }
066:
067:            /**
068:             * @see javax.management.NotificationBroadcaster#addNotificationListener(javax.management.NotificationListener,
069:             *      javax.management.NotificationFilter, java.lang.Object)
070:             */
071:            public void addNotificationListener(NotificationListener listener,
072:                    NotificationFilter filter, Object handback) {
073:                broadcaster.addNotificationListener(listener, filter, handback);
074:            }
075:
076:            /**
077:             * Returns the notification broadcaster.
078:             * 
079:             * @return a <code>NotificationBroadcasterSupport</code>
080:             */
081:            public NotificationBroadcasterSupport getBroadcaster() {
082:                return broadcaster;
083:            }
084:
085:            /**
086:             * @see javax.management.NotificationBroadcaster#getNotificationInfo()
087:             */
088:            public MBeanNotificationInfo[] getNotificationInfo() {
089:                // is the broadcaster already initialized ?
090:                if (broadcaster == null)
091:                    // no we return empty array
092:                    return new MBeanNotificationInfo[0];
093:
094:                return broadcaster.getNotificationInfo();
095:            }
096:
097:            /**
098:             * @see javax.management.NotificationBroadcaster#removeNotificationListener(javax.management.NotificationListener)
099:             */
100:            public void removeNotificationListener(NotificationListener listener)
101:                    throws ListenerNotFoundException {
102:                broadcaster.removeNotificationListener(listener);
103:            }
104:
105:            /**
106:             * @see javax.management.NotificationEmitter#removeNotificationListener(javax.management.NotificationListener,
107:             *      javax.management.NotificationFilter, java.lang.Object)
108:             */
109:            public void removeNotificationListener(
110:                    NotificationListener listener, NotificationFilter filter,
111:                    Object handback) throws ListenerNotFoundException {
112:                broadcaster.removeNotificationListener(listener, filter,
113:                        handback);
114:            }
115:
116:            /**
117:             * Sends a notification.
118:             * 
119:             * @param notification The notification to send.
120:             */
121:            public void sendNotification(Notification notification) {
122:                broadcaster.sendNotification(notification);
123:            }
124:
125:            //
126:            // StandardMBean methods
127:            //
128:
129:            /**
130:             * Allow to retrieve internationalization description on mbeans as well
131:             * 
132:             * @return part of the key to look for in the translation file.
133:             */
134:            public abstract String getAssociatedString();
135:
136:            /**
137:             * Returns the description of the MBean.
138:             * 
139:             * @return a <code>String</code> containing the description
140:             */
141:            protected String getDescription(MBeanInfo info) {
142:                return JmxTranslate.get("mbean." + getAssociatedString()
143:                        + ".description");
144:            }
145:
146:            /**
147:             * @see javax.management.StandardMBean#getDescription(javax.management.MBeanConstructorInfo)
148:             */
149:            protected String getDescription(MBeanConstructorInfo ctor) {
150:                return JmxTranslate.get("mbean." + getAssociatedString()
151:                        + ".constructor." + ctor.getSignature().length);
152:            }
153:
154:            /**
155:             * @see javax.management.StandardMBean#getParameterName(javax.management.MBeanConstructorInfo,
156:             *      javax.management.MBeanParameterInfo, int)
157:             */
158:            protected String getParameterName(MBeanConstructorInfo ctor,
159:                    MBeanParameterInfo param, int sequence) {
160:                return JmxTranslate.get("mbean." + getAssociatedString()
161:                        + ".constructor." + ctor.getSignature().length
162:                        + ".parameter.name." + sequence);
163:            }
164:
165:            /**
166:             * @see javax.management.StandardMBean#getDescription(javax.management.MBeanConstructorInfo,
167:             *      javax.management.MBeanParameterInfo, int)
168:             */
169:            protected String getDescription(MBeanConstructorInfo ctor,
170:                    MBeanParameterInfo param, int sequence) {
171:                return JmxTranslate.get("mbean." + getAssociatedString()
172:                        + ".constructor." + ctor.getSignature().length
173:                        + ".parameter.description." + sequence);
174:            }
175:
176:            /**
177:             * @see javax.management.StandardMBean#getDescription(javax.management.MBeanAttributeInfo)
178:             */
179:            protected String getDescription(MBeanAttributeInfo info) {
180:                return JmxTranslate.get("mbean." + getAssociatedString()
181:                        + ".attribute." + info.getName());
182:            }
183:
184:            /**
185:             * @see javax.management.StandardMBean#getDescription(javax.management.MBeanOperationInfo)
186:             */
187:            protected String getDescription(MBeanOperationInfo info) {
188:                return JmxTranslate.get("mbean." + getAssociatedString() + "."
189:                        + info.getName());
190:            }
191:
192:            /**
193:             * @see javax.management.StandardMBean#getParameterName(javax.management.MBeanOperationInfo,
194:             *      javax.management.MBeanParameterInfo, int)
195:             */
196:            protected String getParameterName(MBeanOperationInfo op,
197:                    MBeanParameterInfo param, int sequence) {
198:                return JmxTranslate.get("mbean." + getAssociatedString() + "."
199:                        + op.getName() + ".parameter.name." + sequence);
200:            }
201:
202:            /**
203:             * @see javax.management.StandardMBean#getDescription(javax.management.MBeanOperationInfo,
204:             *      javax.management.MBeanParameterInfo, int)
205:             */
206:            protected String getDescription(MBeanOperationInfo op,
207:                    MBeanParameterInfo param, int sequence) {
208:                return JmxTranslate.get("mbean." + getAssociatedString() + "."
209:                        + op.getName() + ".parameter.description." + sequence);
210:            }
211:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.