Source Code Cross Referenced for WsdlPublish.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » jonas » ant » jonasbase » wsdl » 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.wsdl 
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: WsdlPublish.java 6899 2005-06-07 13:48:06Z pelletib $
024:         * --------------------------------------------------------------------------
025:         */package org.objectweb.jonas.ant.jonasbase.wsdl;
026:
027:        import java.util.ArrayList;
028:        import java.util.Iterator;
029:        import java.util.List;
030:        import java.util.Properties;
031:
032:        import org.objectweb.jonas.ant.JOnASBaseTask;
033:        import org.objectweb.jonas.ant.jonasbase.BaseTaskItf;
034:        import org.objectweb.jonas.ant.jonasbase.JReplace;
035:        import org.objectweb.jonas.ant.jonasbase.JTask;
036:
037:        /**
038:         * Generates files for WSDL publish
039:         * @author Florent Benoit
040:         */
041:        public class WsdlPublish extends JTask implements  BaseTaskItf {
042:
043:            /**
044:             * Info for the logger
045:             */
046:            private static final String INFO = "[WSDL-Publish] ";
047:
048:            /**
049:             * Property for WSDL Handler
050:             */
051:            private static final String WSDL_HANDLER_PROPERTY = "jonas.service.ws.wsdlhandlers";
052:
053:            /**
054:             * Default property for WSDL handlers
055:             */
056:            private static final String TOKEN_WSDLHANDLER = WSDL_HANDLER_PROPERTY
057:                    + " file1";
058:
059:            /**
060:             * List of files (WSDL publish)
061:             */
062:            private List files = new ArrayList();
063:
064:            /**
065:             * List of uddi (WSDL publish)
066:             */
067:            private List uddis = new ArrayList();
068:
069:            /**
070:             * Add file (wsdl publish)
071:             * @param file properties file
072:             */
073:            public void addConfiguredFile(File file) {
074:                files.add(file);
075:            }
076:
077:            /**
078:             * Add UDDI (wsdl publish)
079:             * @param uddi properties file
080:             */
081:            public void addConfiguredUddi(Uddi uddi) {
082:                uddis.add(uddi);
083:            }
084:
085:            /**
086:             * set files (wsdl publish)
087:             * @param files list of properties file
088:             */
089:            public void setFiles(List files) {
090:                this .files = files;
091:            }
092:
093:            /**
094:             * set uddis (wsdl publish)
095:             * @param uddis list of properties uddi file
096:             */
097:            public void setUddis(List uddis) {
098:                this .uddis = uddis;
099:            }
100:
101:            /**
102:             * Execute this task
103:             */
104:            public void execute() {
105:
106:                String fileNameList = "";
107:
108:                java.io.File jonasBaseConfDir = new java.io.File(getDestDir()
109:                        .getPath()
110:                        + java.io.File.separator + "conf");
111:
112:                // Write file Handler
113:                for (Iterator it = files.iterator(); it.hasNext();) {
114:                    File f = (File) it.next();
115:
116:                    String dir = f.getDir();
117:                    String encoding = f.getEncoding();
118:                    String name = f.getName();
119:
120:                    // Add file to handler list
121:                    if (fileNameList.length() == 0) {
122:                        fileNameList = name;
123:                    } else {
124:                        fileNameList += "," + name;
125:                    }
126:
127:                    String fileName = name + ".properties";
128:
129:                    // Build properties file and write it
130:                    Properties props = new Properties();
131:                    props.put("jonas.service.wsdl.class",
132:                            File.FILEWSDLHANDLER_CLASS);
133:                    props.put("jonas.service.publish.file.directory", dir);
134:                    props.put("jonas.service.publish.file.encoding", encoding);
135:                    java.io.File writeFile = new java.io.File(jonasBaseConfDir,
136:                            fileName);
137:                    log(INFO + "Generating a WSDL publish file with name '"
138:                            + name + "', dir '" + dir + "' and encoding '"
139:                            + encoding + "' in file '" + writeFile + "'...");
140:                    writePropsToFile(INFO, props, writeFile);
141:                }
142:
143:                // Write Uddi Handler
144:                for (Iterator it = uddis.iterator(); it.hasNext();) {
145:                    Uddi uddi = (Uddi) it.next();
146:
147:                    String name = uddi.getName();
148:                    String username = uddi.getUserName();
149:                    String password = uddi.getPassword();
150:                    String orgName = uddi.getOrgName();
151:                    String orgDesc = uddi.getOrgDesc();
152:                    String orgPersonName = uddi.getOrgPersonName();
153:                    String lifecyclemanagerURL = uddi.getLifecyclemanagerURL();
154:                    String queryManagerURL = uddi.getQueryManagerURL();
155:
156:                    // Add file to handler list
157:                    if (fileNameList.length() == 0) {
158:                        fileNameList = name;
159:                    } else {
160:                        fileNameList += "," + name;
161:                    }
162:
163:                    String fileName = name + ".properties";
164:
165:                    // Build properties file and write it
166:                    Properties props = new Properties();
167:                    props.put("jonas.service.wsdl.class",
168:                            Uddi.REGISTRYWSDLHANDLER_CLASS);
169:                    props.put("jonas.service.publish.uddi.username", username);
170:                    props.put("jonas.service.publish.uddi.password", password);
171:                    props.put("jonas.service.publish.uddi.organization.name",
172:                            orgName);
173:                    props.put("jonas.service.publish.uddi.organization.desc",
174:                            orgDesc);
175:                    props
176:                            .put(
177:                                    "jonas.service.publish.uddi.organization.person_name",
178:                                    orgPersonName);
179:                    props.put("javax.xml.registry.lifeCycleManagerURL",
180:                            lifecyclemanagerURL);
181:                    props.put("javax.xml.registry.queryManagerURL",
182:                            queryManagerURL);
183:                    java.io.File writeFile = new java.io.File(jonasBaseConfDir,
184:                            fileName);
185:                    log(INFO + "Generating a WSDL publish UDDI with name '"
186:                            + name + "' in file '" + writeFile + "'...");
187:                    writePropsToFile(INFO, props, writeFile);
188:                }
189:
190:                // Now set the handlers to the existing list for the property
191:                JReplace propertyReplace = new JReplace();
192:                propertyReplace.setProject(getProject());
193:                propertyReplace
194:                        .setConfigurationFile(JOnASBaseTask.JONAS_CONF_FILE);
195:                propertyReplace.setDestDir(new java.io.File(getDestDir()
196:                        .getPath()));
197:                propertyReplace.setToken(TOKEN_WSDLHANDLER);
198:                propertyReplace.setValue(WSDL_HANDLER_PROPERTY + SEPARATORS
199:                        + fileNameList);
200:                log(INFO + "Adding WSDL handlers '" + fileNameList + "' in "
201:                        + JOnASBaseTask.JONAS_CONF_FILE + " file.");
202:                propertyReplace.execute();
203:
204:            }
205:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.