Source Code Cross Referenced for AbstractJMSManager.java in  » EJB-Server-geronimo » plugins » org » apache » geronimo » console » jmsmanager » 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.console.jmsmanager 
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.console.jmsmanager;
017:
018:        import java.util.Map;
019:
020:        import javax.jms.Queue;
021:        import javax.jms.Topic;
022:
023:        import org.apache.geronimo.gbean.AbstractName;
024:        import org.apache.geronimo.gbean.AbstractNameQuery;
025:        import org.apache.geronimo.gbean.GBeanData;
026:        import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
027:        import org.apache.geronimo.kernel.GBeanNotFoundException;
028:        import org.apache.geronimo.kernel.Kernel;
029:        import org.apache.geronimo.kernel.KernelRegistry;
030:        import org.apache.geronimo.kernel.config.Configuration;
031:        import org.apache.geronimo.kernel.config.ConfigurationManager;
032:        import org.apache.geronimo.kernel.config.ConfigurationUtil;
033:        import org.apache.geronimo.kernel.repository.Artifact;
034:
035:        public abstract class AbstractJMSManager {
036:
037:            protected static final Artifact ACTIVEMQ_BROKER_ARTIFACT = new Artifact(
038:                    "geronimo", "activemq-broker",
039:                    org.apache.geronimo.system.serverinfo.ServerConstants
040:                            .getVersion(), "car");
041:            protected static final Artifact ACTIVEMQ_ARTIFACT = new Artifact(
042:                    "geronimo", "activemq",
043:                    org.apache.geronimo.system.serverinfo.ServerConstants
044:                            .getVersion(), "car");
045:            protected static final Kernel kernel = KernelRegistry
046:                    .getSingleKernel();
047:
048:            protected static final ConfigurationManager configurationManager = ConfigurationUtil
049:                    .getConfigurationManager(kernel);
050:            protected final Configuration BROKER_CONFIGURATION = configurationManager
051:                    .getConfiguration(ACTIVEMQ_BROKER_ARTIFACT);
052:            protected final Configuration CONNECTOR_CONFIGURATION = configurationManager
053:                    .getConfiguration(ACTIVEMQ_ARTIFACT);
054:
055:            private static final AbstractName earName = kernel.getNaming()
056:                    .createRootName(ACTIVEMQ_ARTIFACT, NameFactory.NULL,
057:                            NameFactory.J2EE_APPLICATION);
058:            protected static final AbstractName RESOURCE_ADAPTER_MODULE_NAME = kernel
059:                    .getNaming().createChildName(earName,
060:                            ACTIVEMQ_ARTIFACT.toString(),
061:                            NameFactory.RESOURCE_ADAPTER_MODULE);
062:            protected static final AbstractName RESOURCE_ADAPTER_NAME = kernel
063:                    .getNaming().createChildName(RESOURCE_ADAPTER_MODULE_NAME,
064:                            ACTIVEMQ_ARTIFACT.toString(),
065:                            NameFactory.RESOURCE_ADAPTER);
066:            protected static final AbstractName JCA_RESOURCE_NAME = kernel
067:                    .getNaming().createChildName(RESOURCE_ADAPTER_NAME,
068:                            ACTIVEMQ_ARTIFACT.toString(),
069:                            NameFactory.JCA_RESOURCE);
070:            protected static final AbstractName JCA_CONNECTION_FACTORY_NAME = kernel
071:                    .getNaming().createChildName(JCA_RESOURCE_NAME,
072:                            "DefaultActiveMQConnectionFactory",
073:                            NameFactory.JCA_CONNECTION_FACTORY);
074:            protected static final AbstractName JCA_MANAGED_CONNECTION_FACTORY_NAME = kernel
075:                    .getNaming().createChildName(JCA_CONNECTION_FACTORY_NAME,
076:                            "DefaultActiveMQConnectionFactory",
077:                            NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
078:
079:            protected static final String GET_BROKER_ADMIN_FUNCTION = "getBrokerAdmin";
080:
081:            public static final String TOPIC_TYPE = "Topic";
082:
083:            public static final String QUEUE_TYPE = "Queue";
084:
085:            //ViewDestinations attribute names
086:            protected static final String DESTINATION_LIST = "destinations";
087:
088:            protected static final String DESTINATION_MSG = "destinationsMsg";
089:
090:            //CreateDestinations attribute names
091:            protected static final String DESTINATION_NAME = "destinationMessageDestinationName";
092:
093:            protected static final String DESTINATION_PHYSICAL_NAME = "destinationPhysicalName";
094:
095:            protected static final String DESTINATION_TYPE = "destinationType";
096:
097:            protected static final String DESTINATION_APPLICATION_NAME = "destinationApplicationName";
098:
099:            protected static final String DESTINATION_MODULE_NAME = "destinationModuleName";
100:
101:            protected static final String DESTINATION_CONFIG_URI = "destinationConfigURI";
102:
103:            protected static Object[] no_args = new Object[0];
104:
105:            protected static String[] no_params = new String[0];
106:
107:            protected static final String BASE_CONFIG_URI = "runtimedestination/";
108:
109:            protected GBeanData getResourceAdapterModuleData()
110:                    throws GBeanNotFoundException {
111:                return CONNECTOR_CONFIGURATION
112:                        .findGBeanData(new AbstractNameQuery(
113:                                RESOURCE_ADAPTER_MODULE_NAME));
114:            }
115:
116:            protected GBeanData getQueueGBeanData()
117:                    throws GBeanNotFoundException {
118:                GBeanData moduleData = getResourceAdapterModuleData();
119:                Map adminObjects = (Map) moduleData
120:                        .getAttribute("adminObjectInfoMap");
121:                GBeanData queueData = (GBeanData) adminObjects.get(Queue.class
122:                        .getName());
123:                return new GBeanData(queueData);
124:            }
125:
126:            protected GBeanData getTopicGBeanData()
127:                    throws GBeanNotFoundException {
128:                GBeanData moduleData = getResourceAdapterModuleData();
129:                Map adminObjects = (Map) moduleData
130:                        .getAttribute("adminObjectInfoMap");
131:                GBeanData queueData = (GBeanData) adminObjects.get(Topic.class
132:                        .getName());
133:                return new GBeanData(queueData);
134:            }
135:
136:            //    protected ObjectName mBeanName;
137:
138:            //    public static final ObjectName DESTINATION_QUERY;
139:
140:            //    public static final ObjectName ACTIVEMQJCA_RESOURCE_QUERY;
141:
142:            //    public static final String ACTIVEMQJCA_RESOURCE;
143:
144:            //    static {
145:            //        try {
146:            //
147:            //            DESTINATION_QUERY = ObjectName
148:            //                    .getInstance("geronimo.server:j2eeType="
149:            //                            + NameFactory.JCA_ADMIN_OBJECT + ",*");
150:            //            ACTIVEMQJCA_RESOURCE_QUERY = ObjectName
151:            //                    .getInstance("*:j2eeType=JCAManagedConnectionFactory,name=DefaultActiveMQConnectionFactory,*");
152:            //            ACTIVEMQJCA_RESOURCE = getActiveMQJCA_RESOURCE(ACTIVEMQJCA_RESOURCE_QUERY);
153:            //
154:            //            if (null == ACTIVEMQJCA_RESOURCE) {
155:            //                throw new RuntimeException(
156:            //                        "No JCA resource was found for DefaultActiveMQConnectionFactory");
157:            //            }
158:            //
159:            //        } catch (MalformedObjectNameException e) {
160:            //            throw new RuntimeException(e);
161:            //        }
162:            //    }
163:            //
164:            //    public static final J2eeContext baseContext = new J2eeContextImpl(
165:            //            "geronimo.server", "geronimo", "null", ACTIVEMQJCA_RESOURCE, null,
166:            //            null, NameFactory.JCA_ADMIN_OBJECT);
167:            //
168:            /**
169:             * Get the JCA resource name of the activemq bean.
170:             *
171:             * @return JCA resource name
172:             */
173:            //    public static String getActiveMQJCA_RESOURCE(ObjectName obj) {
174:            //
175:            //        Set modules = kernel.listGBeans(obj);
176:            //
177:            //        String JCA_Resource = null;
178:            //
179:            //        for (Iterator iterator = modules.iterator(); iterator.hasNext();) {
180:            //            ObjectName activemqObject = (ObjectName) iterator.next();
181:            //            JCA_Resource = activemqObject
182:            //                    .getKeyProperty(NameFactory.JCA_RESOURCE);
183:            //        }
184:            //
185:            //        return JCA_Resource;
186:            //    }
187:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.