Source Code Cross Referenced for NamingConventionConstructingProvider.java in  » Inversion-of-Control » PicoContainer » org » picocontainer » gems » 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 » Inversion of Control » PicoContainer » org.picocontainer.gems.jmx 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        /*****************************************************************************
02:         * Copyright (C) NanoContainer Organization. All rights reserved.            *
03:         * ------------------------------------------------------------------------- *
04:         * The software in this package is published under the terms of the BSD      *
05:         * style license a copy of which has been included with this distribution in *
06:         * the LICENSE.txt file.                                                     *
07:         *                                                                           *
08:         * Original code by Joerg Schaible                                           *
09:         *****************************************************************************/package org.picocontainer.gems.jmx;
10:
11:        import javax.management.MBeanInfo;
12:
13:        /**
14:         * A DynamicMBeanProvider that constructs StandardMBean instances that follow the JMX naming conventions. The name of
15:         * the management interface must follow the naming conventions with an <em>MBean</em> appended to the MBean's type.
16:         * The implementation will use the registered MBeanInfoProvider instances of type
17:         * {@link ComponentKeyConventionMBeanInfoProvider} and {@link ComponentTypeConventionMBeanInfoProvider} to provide a
18:         * {@link MBeanInfo} for the component's MBean. If a {@link MBeanInfo} was found, the MBean's type is used from the
19:         * MBeanInfo otherwise the type is the implementation class of the component.
20:         * @author J&ouml;rg Schaible
21:         */
22:        public class NamingConventionConstructingProvider extends
23:                AbstractConstructingProvider {
24:
25:            private final ObjectNameFactory objectNameFactory;
26:            private final MBeanInfoProvider[] mBeanProviders;
27:            private final StandardMBeanFactory mBeanFactory;
28:
29:            /**
30:             * Construct a NamingConventionConstructingProvider. Following {@link MBeanInfoProvider} instances are registered
31:             * with this constructor:
32:             * <ul>
33:             * <li>{@link ComponentKeyConventionMBeanInfoProvider}</li>
34:             * <li>{@link ComponentTypeConventionMBeanInfoProvider}</li>
35:             * </ul>
36:             * @param factory The ObjectNameFactory used to name the created MBeans.
37:             */
38:            public NamingConventionConstructingProvider(
39:                    final ObjectNameFactory factory) {
40:                if (factory == null) {
41:                    throw new NullPointerException("ObjectNameFactory is null");
42:                }
43:                mBeanFactory = new StandardMBeanFactory();
44:                objectNameFactory = factory;
45:                mBeanProviders = new MBeanInfoProvider[] {
46:                        new ComponentKeyConventionMBeanInfoProvider(),
47:                        new ComponentTypeConventionMBeanInfoProvider() };
48:            }
49:
50:            /**
51:             * Return a {@link StandardMBeanFactory}.
52:             * @see org.picocontainer.gems.jmx.AbstractConstructingProvider#getMBeanFactory()
53:             */
54:            protected DynamicMBeanFactory getMBeanFactory() {
55:                return mBeanFactory;
56:            }
57:
58:            /**
59:             * @see org.picocontainer.gems.jmx.AbstractConstructingProvider#getObjectNameFactory()
60:             */
61:            public ObjectNameFactory getObjectNameFactory() {
62:                return objectNameFactory;
63:            }
64:
65:            /**
66:             * Return an array with an instance of type {@link ComponentKeyConventionMBeanInfoProvider} and
67:             * {@link ComponentTypeConventionMBeanInfoProvider}.
68:             * @see org.picocontainer.gems.jmx.AbstractConstructingProvider#getMBeanInfoProviders()
69:             */
70:            public MBeanInfoProvider[] getMBeanInfoProviders() {
71:                return mBeanProviders;
72:            }
73:
74:            /**
75:             * Determin the default management interface using naming convetions of the JMX specification.
76:             * @param implementation The type of the component's implementation.
77:             * @param mBeanInfo The {@link MBeanInfo} to expose the component. May be <code>null</code>.
78:             * @return Returns the management interface.
79:             * @throws ClassNotFoundException Thrown if no interface can be determined.
80:             */
81:            protected Class getManagementInterface(final Class implementation,
82:                    final MBeanInfo mBeanInfo) throws ClassNotFoundException {
83:                return mBeanFactory.getDefaultManagementInterface(
84:                        implementation, mBeanInfo);
85:            }
86:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.