Source Code Cross Referenced for BSAdapterGeneratorImpl.java in  » UML » MetaBoss » com » metaboss » sdlctools » services » codegeneration » servicemoduleadaptergenerator » soap » tomcatjwsdp » 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 » UML » MetaBoss » com.metaboss.sdlctools.services.codegeneration.servicemoduleadaptergenerator.soap.tomcatjwsdp 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
002:        // CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
003:        // BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
004:        // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
005:        // OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
006:        // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
007:        // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
008:        // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
009:        // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
010:        // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
011:        // EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
012:        // POSSIBILITY OF SUCH DAMAGE.
013:        //
014:        // Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
015:        package com.metaboss.sdlctools.services.codegeneration.servicemoduleadaptergenerator.soap.tomcatjwsdp;
016:
017:        import java.util.HashMap;
018:        import java.util.Map;
019:
020:        import javax.naming.Context;
021:        import javax.naming.InitialContext;
022:        import javax.naming.NamingException;
023:
024:        import org.apache.commons.logging.Log;
025:        import org.apache.commons.logging.LogFactory;
026:
027:        import com.metaboss.enterprise.bs.BSException;
028:        import com.metaboss.enterprise.bs.BSNamingAndDirectoryServiceInvocationException;
029:        import com.metaboss.enterprise.bs.BSServiceProviderException;
030:        import com.metaboss.sdlctools.frameworks.generation.internal.GenerationPlan;
031:        import com.metaboss.sdlctools.frameworks.generation.internal.Generator;
032:        import com.metaboss.sdlctools.models.ModelRepository;
033:        import com.metaboss.sdlctools.models.ModelRepositoryException;
034:        import com.metaboss.sdlctools.models.metabossmodel.MetaBossModelPackage;
035:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.Servicemodule;
036:        import com.metaboss.sdlctools.services.codegeneration.BSAdapterGenerator;
037:        import com.metaboss.sdlctools.services.codegeneration.CodeGenerationStylesheetAccessor;
038:        import com.metaboss.sdlctools.services.codegenerationstylesheet.STDataDictionaryStylesheet;
039:        import com.metaboss.sdlctools.services.codegenerationstylesheet.STServicemoduleStylesheet;
040:        import com.metaboss.util.DirectoryUtils;
041:
042:        /** Generator of adapter from Apache Tomcat SOAP server using Sun's Java Web Servies Development Pack */
043:        public class BSAdapterGeneratorImpl implements  BSAdapterGenerator {
044:            // Commons Logging instance.
045:            private static final Log sLogger = LogFactory
046:                    .getLog(BSAdapterGeneratorImpl.class);
047:            // Class name of the generated internal class 
048:            private static final String sXMLUtilitiesClassName = "XMLUtilities";
049:            // Default context to pass to every generator
050:            private Map mDefaultContext = new HashMap();
051:
052:            public BSAdapterGeneratorImpl(java.util.Hashtable pEnvironment) {
053:            }
054:
055:            /* @return array of names of adapters, which are required by this adapter,
056:             * may be zero length array if this adapter is not relying on any other one. */
057:            public String[] getRequiredAdapters() throws BSException {
058:                return new String[0];
059:            }
060:
061:            // Generates servicemodules adapter sourcecode for the particular servicemodule within particular enterprise
062:            public void generateSourceCodeForServicemodule(
063:                    String pDestinationDirectory, String pServicemoduleRef)
064:                    throws BSException {
065:                try {
066:                    sLogger
067:                            .info("Generating SOAP adapter implementation based on Tomcat and JWSDP for "
068:                                    + pServicemoduleRef + " servicemodule...");
069:                    // Obtain model repository
070:                    Context lContext = new InitialContext();
071:                    ModelRepository lModelRepository = (ModelRepository) lContext
072:                            .lookup(ModelRepository.COMPONENT_URL);
073:                    MetaBossModelPackage lMetaBossModelPackage = (MetaBossModelPackage) lModelRepository
074:                            .getDefaultModelExtent();
075:                    Servicemodule lServicemodule = (Servicemodule) lMetaBossModelPackage
076:                            .getModelElement().getByRef(pServicemoduleRef);
077:                    GenerationPlan lGenerationPlan = new GenerationPlanImpl(); // Set of generation instructions
078:                    // Ensure that directory exists
079:                    DirectoryUtils
080:                            .ensureThereIsDirectory(pDestinationDirectory);
081:                    // First do the copying of resources
082:                    long lNumberOfCreatedFiles = Generator.doCopying(
083:                            pDestinationDirectory, lGenerationPlan);
084:                    // Now perform generation
085:                    lNumberOfCreatedFiles += Generator
086:                            .doGenerationForElementTree(pDestinationDirectory,
087:                                    lServicemodule, lGenerationPlan,
088:                                    mDefaultContext);
089:                    sLogger.info("Created " + lNumberOfCreatedFiles
090:                            + " files. Generation complete.");
091:                } catch (ModelRepositoryException e) {
092:                    throw new BSServiceProviderException(
093:                            "Caught repository exeption. Generation aborted.",
094:                            e);
095:                } catch (NamingException e) {
096:                    throw new BSNamingAndDirectoryServiceInvocationException(
097:                            "Caught naming exeption. Generation aborted.", e);
098:                }
099:            }
100:
101:            /* Returns the name of the package where adapter code is generated to */
102:            public String getPackageNameForServicemoduleServices(
103:                    String pServicemoduleRef) throws BSException {
104:                // This is a standard adapter - so stylesheet dictates the package name
105:                STServicemoduleStylesheet lServicemoduleStylesheet = CodeGenerationStylesheetAccessor
106:                        .getServicemoduleStylesheet(pServicemoduleRef);
107:                return lServicemoduleStylesheet.getAdaptersRootPackageName()
108:                        + ".soap.tomcatjwsdp.services."
109:                        + lServicemoduleStylesheet.getSystemSubPackageName();
110:            }
111:
112:            public String getPackageNameForServicemoduleEventPublishers(
113:                    String pServicemoduleRef) throws BSException {
114:                // This is a standard adapter - so stylesheet dictates the package name
115:                STServicemoduleStylesheet lServicemoduleStylesheet = CodeGenerationStylesheetAccessor
116:                        .getServicemoduleStylesheet(pServicemoduleRef);
117:                return lServicemoduleStylesheet.getAdaptersRootPackageName()
118:                        + ".soap.tomcatjwsdp.eventpublishers."
119:                        + lServicemoduleStylesheet.getSystemSubPackageName();
120:            }
121:
122:            /** Generates adapter implementation sourcecode for the particular data dictionary
123:             * @param pGenerationDirectoryPath directory to generate code to
124:             * @param pDataDictionaryRef identifier of the datadictionary to generate the code for
125:             */
126:            public void generateSourceCodeForDataDictionary(
127:                    String pGenerationDirectoryPath, String pDataDictionaryRef)
128:                    throws BSException {
129:                //TODO: Generate
130:                //    	throw new BSUnsupportedOperationException("Opperation generateSourceCodeForDataDictionary() is not yet supported.");
131:            }
132:
133:            /** Returns the name of the package where adapter code is generated to
134:             * @param pDataDictionaryRef identifier of the datadictionary to generate the code for
135:             */
136:            public String getPackageNameForDataDictionary(
137:                    String pDataDictionaryRef) throws BSException {
138:                STDataDictionaryStylesheet lDataDictionaryStylesheet = CodeGenerationStylesheetAccessor
139:                        .getDataDictionaryStylesheet(pDataDictionaryRef);
140:                return lDataDictionaryStylesheet.getAdaptersRootPackageName()
141:                        + ".soap.tomcatjwsdp";
142:            }
143:        }
w___w_w___.___j__a_v___a_2_s___.___c_o___m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.