Source Code Cross Referenced for J2EEAppClientModuleImpl.java in  » EJB-Server-geronimo » j2ee » org » apache » geronimo » j2ee » management » impl » 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 » EJB Server geronimo » j2ee » org.apache.geronimo.j2ee.management.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         *  Licensed to the Apache Software Foundation (ASF) under one or more
003:         *  contributor license agreements.  See the NOTICE file distributed with
004:         *  this work for additional information regarding copyright ownership.
005:         *  The ASF licenses this file to You under the Apache License, Version 2.0
006:         *  (the "License"); you may not use this file except in compliance with
007:         *  the License.  You may obtain a copy of the License at
008:         *
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         *  Unless required by applicable law or agreed to in writing, software
012:         *  distributed under the License is distributed on an "AS IS" BASIS,
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *  See the License for the specific language governing permissions and
015:         *  limitations under the License.
016:         */package org.apache.geronimo.j2ee.management.impl;
017:
018:        import java.util.Hashtable;
019:        import javax.management.ObjectName;
020:
021:        import org.apache.geronimo.gbean.GBeanInfo;
022:        import org.apache.geronimo.gbean.GBeanInfoBuilder;
023:        import org.apache.geronimo.management.J2EEApplication;
024:        import org.apache.geronimo.management.J2EEServer;
025:        import org.apache.geronimo.management.AppClientModule;
026:        import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
027:        import org.apache.geronimo.kernel.ObjectNameUtil;
028:
029:        /**
030:         * @version $Revision: 476049 $ $Date: 2006-11-16 20:35:17 -0800 (Thu, 16 Nov 2006) $
031:         */
032:        public class J2EEAppClientModuleImpl implements  AppClientModule {
033:            private final String deploymentDescriptor;
034:            private final J2EEServer server;
035:            private final J2EEApplication application;
036:            private final ClassLoader classLoader;
037:            private final String objectName;
038:
039:            public J2EEAppClientModuleImpl(String objectName,
040:                    J2EEServer server, J2EEApplication application,
041:                    String deploymentDescriptor, ClassLoader classLoader) {
042:                this .objectName = objectName;
043:                ObjectName myObjectName = ObjectNameUtil
044:                        .getObjectName(this .objectName);
045:                verifyObjectName(myObjectName);
046:
047:                this .server = server;
048:                this .application = application;
049:                this .deploymentDescriptor = deploymentDescriptor;
050:                this .classLoader = classLoader;
051:            }
052:
053:            public String getObjectName() {
054:                return objectName;
055:            }
056:
057:            public boolean isStateManageable() {
058:                return true;
059:            }
060:
061:            public boolean isStatisticsProvider() {
062:                return false;
063:            }
064:
065:            public boolean isEventProvider() {
066:                return true;
067:            }
068:
069:            /**
070:             * ObjectName must match this pattern:
071:             * <p/>
072:             * domain:j2eeType=AppClientModule,name=MyName,J2EEServer=MyServer,J2EEApplication=MyApplication
073:             */
074:            private void verifyObjectName(ObjectName objectName) {
075:                if (objectName.isPattern()) {
076:                    throw new InvalidObjectNameException(
077:                            "ObjectName can not be a pattern", objectName);
078:                }
079:                Hashtable keyPropertyList = objectName.getKeyPropertyList();
080:                if (!"AppClientModule".equals(keyPropertyList.get("j2eeType"))) {
081:                    throw new InvalidObjectNameException(
082:                            "AppClientModule object name j2eeType property must be 'AppClientModule'",
083:                            objectName);
084:                }
085:                if (!keyPropertyList.containsKey("name")) {
086:                    throw new InvalidObjectNameException(
087:                            "AppClientModule object must contain a name property",
088:                            objectName);
089:                }
090:                if (!keyPropertyList.containsKey("J2EEServer")) {
091:                    throw new InvalidObjectNameException(
092:                            "AppClientModule object name must contain a J2EEServer property",
093:                            objectName);
094:                }
095:                if (!keyPropertyList.containsKey("J2EEApplication")) {
096:                    throw new InvalidObjectNameException(
097:                            "AppClientModule object name must contain a J2EEApplication property",
098:                            objectName);
099:                }
100:                if (keyPropertyList.size() != 4) {
101:                    throw new InvalidObjectNameException(
102:                            "AppClientModule object name can only have j2eeType, name, J2EEApplication, and J2EEServer properties",
103:                            objectName);
104:                }
105:            }
106:
107:            public String getDeploymentDescriptor() {
108:                return deploymentDescriptor;
109:            }
110:
111:            public String getServer() {
112:                return server.getObjectName();
113:            }
114:
115:            public String getApplication() {
116:                if (application == null) {
117:                    return null;
118:                }
119:                return application.getObjectName();
120:            }
121:
122:            public String[] getJavaVMs() {
123:                return server.getJavaVMs();
124:            }
125:
126:            public ClassLoader getClassLoader() {
127:                return classLoader;
128:            }
129:
130:            public static final GBeanInfo GBEAN_INFO;
131:
132:            static {
133:                GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(
134:                        J2EEAppClientModuleImpl.class,
135:                        NameFactory.APP_CLIENT_MODULE);
136:                infoFactory.addReference("J2EEServer", J2EEServer.class);
137:                infoFactory.addReference("J2EEApplication",
138:                        J2EEApplication.class);
139:
140:                infoFactory.addAttribute("deploymentDescriptor", String.class,
141:                        true);
142:
143:                infoFactory.addAttribute("objectName", String.class, false);
144:                infoFactory.addAttribute("server", String.class, false);
145:                infoFactory.addAttribute("application", String.class, false);
146:                infoFactory.addAttribute("javaVMs", String[].class, false);
147:                infoFactory.addAttribute("classLoader", ClassLoader.class,
148:                        false);
149:                infoFactory.addInterface(AppClientModule.class);
150:
151:                infoFactory.setConstructor(new String[] { "objectName",
152:                        "J2EEServer", "J2EEApplication",
153:                        "deploymentDescriptor", "classLoader" });
154:
155:                GBEAN_INFO = infoFactory.getBeanInfo();
156:            }
157:
158:            public static GBeanInfo getGBeanInfo() {
159:                return GBEAN_INFO;
160:            }
161:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.