Source Code Cross Referenced for Jms.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » jonas » ant » jonasbase » 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 » JOnAS 4.8.6 » org.objectweb.jonas.ant.jonasbase 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * JOnAS: Java(TM) Open Application Server
003:         * Copyright (C) 2004 Bull S.A.
004:         * Contact: jonas-team@objectweb.org
005:         *
006:         * This library is free software; you can redistribute it and/or
007:         * modify it under the terms of the GNU Lesser General Public
008:         * License as published by the Free Software Foundation; either
009:         * version 2.1 of the License, or any later version.
010:         *
011:         * This library is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         * Lesser General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU Lesser General Public
017:         * License along with this library; if not, write to the Free Software
018:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
019:         * USA
020:         *
021:         * Initial developer: Florent BENOIT
022:         * --------------------------------------------------------------------------
023:         * $Id: Jms.java 7884 2006-01-11 08:30:02Z pelletib $
024:         * --------------------------------------------------------------------------
025:         */package org.objectweb.jonas.ant.jonasbase;
026:
027:        import java.util.StringTokenizer;
028:
029:        import org.objectweb.jonas.ant.JOnASBaseTask;
030:
031:        /**
032:         * Allow to configure the JMS service
033:         * @author Florent Benoit
034:         */
035:        public class Jms extends Tasks {
036:
037:            /**
038:             * Info for the logger
039:             */
040:            private static final String INFO = "[JMS] ";
041:
042:            /**
043:             * Default port number
044:             */
045:            private static final String DEFAULT_PORT = "16010";
046:
047:            /**
048:             * Token for the end of the joramAdmin configuration file
049:             */
050:            private static final String TOKEN_END_CONF_FILE = "</JoramAdmin>";
051:
052:            /**
053:             * Default constructor
054:             */
055:            public Jms() {
056:                super ();
057:            }
058:
059:            /**
060:             * Set the port number for Joram
061:             * @param portNumber the port for Joram
062:             */
063:            public void setPort(String portNumber) {
064:
065:                // For JMS
066:                JReplace propertyReplace = new JReplace();
067:                propertyReplace
068:                        .setConfigurationFile(JOnASBaseTask.JORAM_CONF_FILE);
069:                propertyReplace.setToken(DEFAULT_PORT);
070:                propertyReplace.setValue(portNumber);
071:                propertyReplace.setLogInfo(INFO
072:                        + "Setting Joram port number to : " + portNumber
073:                        + " in " + JOnASBaseTask.JORAM_CONF_FILE + " file.");
074:                addTask(propertyReplace);
075:
076:                // for RAR file
077:                propertyReplace = new JReplace();
078:                propertyReplace
079:                        .setConfigurationFile(JOnASBaseTask.JORAM_ADMIN_CONF_FILE);
080:                propertyReplace.setToken(DEFAULT_PORT);
081:                propertyReplace.setValue(portNumber);
082:                propertyReplace.setLogInfo(INFO
083:                        + "Setting Joram port number to : " + portNumber
084:                        + " in " + JOnASBaseTask.JORAM_ADMIN_CONF_FILE
085:                        + " file.");
086:                addTask(propertyReplace);
087:
088:                // Patch the RAR file
089:                JmsRa jmsRa = new JmsRa();
090:                jmsRa.setServerPort(portNumber);
091:                addTask(jmsRa);
092:
093:            }
094:
095:            /**
096:             * Set the initial topics when JOnAS start
097:             * @param initialTopics comma separated list of topics
098:             */
099:            public void setInitialTopics(String initialTopics) {
100:                JReplace propertyReplace = new JReplace();
101:                propertyReplace
102:                        .setConfigurationFile(JOnASBaseTask.JORAM_ADMIN_CONF_FILE);
103:                propertyReplace.setToken(TOKEN_END_CONF_FILE);
104:                String tokenValue = "";
105:                StringTokenizer st = new StringTokenizer(initialTopics, ",");
106:
107:                while (st.hasMoreTokens()) {
108:                    String topic = st.nextToken();
109:                    tokenValue += " <Topic name=\"" + topic + "\">" + "\n"
110:                            + "  <freeReader/>" + "\n" + "  <freeWriter/>"
111:                            + "\n" + "  <jndi name=\"" + topic + "\"/>" + "\n"
112:                            + " </Topic>" + "\n";
113:                }
114:
115:                tokenValue += TOKEN_END_CONF_FILE;
116:
117:                propertyReplace.setValue(tokenValue);
118:                propertyReplace.setLogInfo(INFO
119:                        + "Setting initial topics to : " + initialTopics);
120:                addTask(propertyReplace);
121:            }
122:
123:            /**
124:             * Set the initial queues when JOnAS start
125:             * @param initialQueues comma separated list of topics
126:             */
127:            public void setInitialQueues(String initialQueues) {
128:                JReplace propertyReplace = new JReplace();
129:                propertyReplace
130:                        .setConfigurationFile(JOnASBaseTask.JORAM_ADMIN_CONF_FILE);
131:                propertyReplace.setToken(TOKEN_END_CONF_FILE);
132:
133:                String tokenValue = "";
134:                StringTokenizer st = new StringTokenizer(initialQueues, ",");
135:
136:                while (st.hasMoreTokens()) {
137:                    String queue = st.nextToken();
138:                    tokenValue += " <Queue name=\"" + queue + "\">" + "\n"
139:                            + "  <freeReader/>" + "\n" + "  <freeWriter/>"
140:                            + "\n" + "  <jndi name=\"" + queue + "\"/>" + "\n"
141:                            + " </Queue>" + "\n";
142:                }
143:
144:                tokenValue += TOKEN_END_CONF_FILE;
145:
146:                propertyReplace.setValue(tokenValue);
147:                propertyReplace.setLogInfo(INFO
148:                        + "Setting initial queues to : " + initialQueues);
149:                addTask(propertyReplace);
150:            }
151:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.