Source Code Cross Referenced for ResourceAdapterModuleImpl.java in  » EJB-Server-geronimo » plugins » org » apache » geronimo » connector » 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 » plugins » org.apache.geronimo.connector 
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.connector;
017:
018:        import java.util.Hashtable;
019:        import java.util.Map;
020:
021:        import javax.management.ObjectName;
022:
023:        import org.apache.geronimo.gbean.GBeanData;
024:        import org.apache.geronimo.j2ee.management.impl.InvalidObjectNameException;
025:        import org.apache.geronimo.kernel.ObjectNameUtil;
026:        import org.apache.geronimo.management.J2EEApplication;
027:        import org.apache.geronimo.management.J2EEServer;
028:        import org.apache.geronimo.management.geronimo.ResourceAdapter;
029:        import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
030:
031:        /**
032:         * @version $Rev: 550546 $ $Date: 2007-06-25 09:52:11 -0700 (Mon, 25 Jun 2007) $
033:         */
034:        public class ResourceAdapterModuleImpl implements  ResourceAdapterModule {
035:            private final J2EEServer server;
036:            private final J2EEApplication application;
037:            private final String deploymentDescriptor;
038:            private final ResourceAdapter resourceAdapter;
039:
040:            private final GBeanData resourceAdapterGBeanData;
041:            private final Map activationSpecInfoMap;
042:            private final Map adminObjectInfoMap;
043:            private final Map managedConnectionFactoryInfoMap;
044:            private final String objectName;
045:            private final String displayName;
046:            private final String description;
047:            private final String vendorName;
048:            private final String resourceAdapterVersion;
049:            private final String eisType;
050:
051:            public ResourceAdapterModuleImpl(String objectName,
052:                    ResourceAdapter resourceAdapter, J2EEServer server,
053:                    J2EEApplication application, String deploymentDescriptor,
054:                    GBeanData resourceAdapterGBeanData,
055:                    Map activationSpecInfoMap, Map adminObjectInfoMap,
056:                    Map managedConnectionFactoryInfoMap, String displayName,
057:                    String description, String vendorName,
058:                    String resourceAdapterVersion, String eisType) {
059:                this .objectName = objectName;
060:                ObjectName myObjectName = ObjectNameUtil
061:                        .getObjectName(objectName);
062:                verifyObjectName(myObjectName);
063:
064:                this .resourceAdapter = resourceAdapter;
065:
066:                this .server = server;
067:                this .application = application;
068:                this .deploymentDescriptor = deploymentDescriptor;
069:
070:                this .resourceAdapterGBeanData = resourceAdapterGBeanData;
071:                this .activationSpecInfoMap = activationSpecInfoMap;
072:                this .adminObjectInfoMap = adminObjectInfoMap;
073:                this .managedConnectionFactoryInfoMap = managedConnectionFactoryInfoMap;
074:                this .description = description;
075:                this .displayName = displayName;
076:                this .vendorName = vendorName;
077:                this .resourceAdapterVersion = resourceAdapterVersion;
078:                this .eisType = eisType;
079:            }
080:
081:            public String getObjectName() {
082:                return objectName;
083:            }
084:
085:            public boolean isStateManageable() {
086:                return true;
087:            }
088:
089:            public boolean isStatisticsProvider() {
090:                return false;
091:            }
092:
093:            public boolean isEventProvider() {
094:                return true;
095:            }
096:
097:            public String getDeploymentDescriptor() {
098:                return deploymentDescriptor;
099:            }
100:
101:            public String getServer() {
102:                return server.getObjectName();
103:            }
104:
105:            public String getApplication() {
106:                if (application == null) {
107:                    return null;
108:                }
109:                return application.getObjectName();
110:            }
111:
112:            public String[] getJavaVMs() {
113:                return server.getJavaVMs();
114:            }
115:
116:            public String[] getResourceAdapters() {
117:                return new String[] { resourceAdapter.getObjectName() };
118:            }
119:
120:            public GBeanData getResourceAdapterGBeanData() {
121:                return resourceAdapterGBeanData;
122:            }
123:
124:            public Map getActivationSpecInfoMap() {
125:                return activationSpecInfoMap;
126:            }
127:
128:            public Map getAdminObjectInfoMap() {
129:                return adminObjectInfoMap;
130:            }
131:
132:            public Map getManagedConnectionFactoryInfoMap() {
133:                return managedConnectionFactoryInfoMap;
134:            }
135:
136:            public String getDisplayName() {
137:                return displayName;
138:            }
139:
140:            public String getDescription() {
141:                return description;
142:            }
143:
144:            public String getVendorName() {
145:                return vendorName;
146:            }
147:
148:            public String getResourceAdapterVersion() {
149:                return resourceAdapterVersion;
150:            }
151:
152:            public String getEISType() {
153:                return eisType;
154:            }
155:
156:            public ResourceAdapter[] getResourceAdapterInstances() {
157:                return new ResourceAdapter[] { resourceAdapter };
158:            }
159:
160:            /**
161:             * ObjectName must match this pattern:
162:             * <p/>
163:             * domain:j2eeType=ResourceAdapterModule,name=MyName,J2EEServer=MyServer,J2EEApplication=MyApplication
164:             */
165:            private void verifyObjectName(ObjectName objectName) {
166:                if (objectName.isPattern()) {
167:                    throw new InvalidObjectNameException(
168:                            "ObjectName can not be a pattern", objectName);
169:                }
170:                Hashtable keyPropertyList = objectName.getKeyPropertyList();
171:                if (!"ResourceAdapterModule".equals(keyPropertyList
172:                        .get("j2eeType"))) {
173:                    throw new InvalidObjectNameException(
174:                            "ResourceAdapterModule object name j2eeType property must be 'ResourceAdapterModule'",
175:                            objectName);
176:                }
177:                if (!keyPropertyList.containsKey("name")) {
178:                    throw new InvalidObjectNameException(
179:                            "ResourceAdapterModule object must contain a name property",
180:                            objectName);
181:                }
182:                if (!keyPropertyList.containsKey("J2EEServer")) {
183:                    throw new InvalidObjectNameException(
184:                            "ResourceAdapterModule object name must contain a J2EEServer property",
185:                            objectName);
186:                }
187:                if (!keyPropertyList.containsKey("J2EEApplication")) {
188:                    throw new InvalidObjectNameException(
189:                            "ResourceAdapterModule object name must contain a J2EEApplication property",
190:                            objectName);
191:                }
192:                if (keyPropertyList.size() != 4) {
193:                    throw new InvalidObjectNameException(
194:                            "ResourceAdapterModule object name can only have j2eeType, name, J2EEApplication, and J2EEServer properties",
195:                            objectName);
196:                }
197:            }
198:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.