Source Code Cross Referenced for ActiveMQResourceAdapter.java in  » J2EE » openejb3 » org » apache » openejb » resource » activemq » 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 » J2EE » openejb3 » org.apache.openejb.resource.activemq 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         *
003:         * Licensed to the Apache Software Foundation (ASF) under one or more
004:         * contributor license agreements.  See the NOTICE file distributed with
005:         * this work for additional information regarding copyright ownership.
006:         * The ASF licenses this file to You under the Apache License, Version 2.0
007:         * (the "License"); you may not use this file except in compliance with
008:         * the License.  You may obtain a copy of the License at
009:         *
010:         *     http://www.apache.org/licenses/LICENSE-2.0
011:         *
012:         *  Unless required by applicable law or agreed to in writing, software
013:         *  distributed under the License is distributed on an "AS IS" BASIS,
014:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015:         *  See the License for the specific language governing permissions and
016:         *  limitations under the License.
017:         */package org.apache.openejb.resource.activemq;
018:
019:        import java.net.URI;
020:        import java.net.URISyntaxException;
021:        import java.util.Properties;
022:        import javax.resource.spi.BootstrapContext;
023:        import javax.resource.spi.ResourceAdapterInternalException;
024:
025:        import org.apache.openejb.util.URISupport;
026:
027:        public class ActiveMQResourceAdapter extends
028:                org.apache.activemq.ra.ActiveMQResourceAdapter {
029:            private String dataSource;
030:
031:            public String getDataSource() {
032:                return dataSource;
033:            }
034:
035:            public void setDataSource(String dataSource) {
036:                this .dataSource = dataSource;
037:            }
038:
039:            //   DMB:  Work in progress.  These all should go into the service-jar.xml
040:            //   Sources of info:
041:            //         - http://activemq.apache.org/resource-adapter-properties.html
042:            //         - http://activemq.apache.org/camel/maven/camel-core/apidocs/org/apache/camel/processor/RedeliveryPolicy.html
043:            //
044:            //    /**
045:            //     * 100	 The maximum number of messages sent to a consumer on a durable topic until acknowledgements are received
046:            //     * @param integer
047:            //     */
048:            //    public void setDurableTopicPrefetch(Integer integer) {
049:            //        super.setDurableTopicPrefetch(integer);
050:            //    }
051:            //
052:            //    /**
053:            //     * 1000	 The delay before redeliveries start. Also configurable on the ActivationSpec.
054:            //     * @param aLong
055:            //     */
056:            //    public void setInitialRedeliveryDelay(Long aLong) {
057:            //        super.setInitialRedeliveryDelay(aLong);
058:            //    }
059:            //
060:            //    /**
061:            //     * 100	 The maximum number of messages sent to a consumer on a JMS stream until acknowledgements are received
062:            //     * @param integer
063:            //     */
064:            //    public void setInputStreamPrefetch(Integer integer) {
065:            //        super.setInputStreamPrefetch(integer);
066:            //    }
067:            //
068:            //    /**
069:            //     * 5	 The maximum number of redeliveries or -1 for no maximum. Also configurable on the ActivationSpec.
070:            //     * @param integer
071:            //     */
072:            //    public void setMaximumRedeliveries(Integer integer) {
073:            //        super.setMaximumRedeliveries(integer);
074:            //    }
075:            //
076:            //    public void setQueueBrowserPrefetch(Integer integer) {
077:            //        super.setQueueBrowserPrefetch(integer);
078:            //    }
079:            //
080:            //    /**
081:            //     * 1000	 The maximum number of messages sent to a consumer on a queue until acknowledgements are received
082:            //     * @param integer
083:            //     */
084:            //    public void setQueuePrefetch(Integer integer) {
085:            //        super.setQueuePrefetch(integer);
086:            //    }
087:            //
088:            //    /**
089:            //     * 5	 The multiplier to use if exponential back off is enabled. Also configurable on the ActivationSpec.
090:            //     * @param aShort
091:            //     */
092:            //    public void setRedeliveryBackOffMultiplier(Short aShort) {
093:            //        super.setRedeliveryBackOffMultiplier(aShort);
094:            //    }
095:            //
096:            //    public void setRedeliveryUseExponentialBackOff(Boolean aBoolean) {
097:            //        super.setRedeliveryUseExponentialBackOff(aBoolean);
098:            //    }
099:            //
100:            //    /**
101:            //     * 32766  The maximum number of messages sent to a consumer on a non-durable topic until acknowledgements are received
102:            //     * @param integer
103:            //     */
104:            //    public void setTopicPrefetch(Integer integer) {
105:            //        super.setTopicPrefetch(integer);
106:            //    }
107:
108:            public void start(BootstrapContext bootstrapContext)
109:                    throws ResourceAdapterInternalException {
110:                Properties properties = new Properties();
111:
112:                // add data source property
113:                if (dataSource != null) {
114:                    properties.put("DataSource", dataSource);
115:                }
116:
117:                // prefix server uri with openejb: so our broker factory is used
118:                String brokerXmlConfig = getBrokerXmlConfig();
119:                if (brokerXmlConfig != null) {
120:                    try {
121:                        URISupport.CompositeData compositeData = URISupport
122:                                .parseComposite(new URI(brokerXmlConfig));
123:                        compositeData.getParameters()
124:                                .put("persistent", "false");
125:                        setBrokerXmlConfig("openejb:" + compositeData.toURI());
126:                    } catch (URISyntaxException e) {
127:                        throw new ResourceAdapterInternalException(
128:                                "Invalid BrokerXmlConfig", e);
129:                    }
130:                }
131:
132:                OpenEjbBrokerFactory.setThreadProperties(properties);
133:                try {
134:                    super .start(bootstrapContext);
135:                } finally {
136:                    OpenEjbBrokerFactory.setThreadProperties(null);
137:
138:                    // reset brokerXmlConfig
139:                    if (brokerXmlConfig != null) {
140:                        setBrokerXmlConfig(brokerXmlConfig);
141:                    }
142:                }
143:            }
144:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.