Source Code Cross Referenced for IncludeDomainImplementationDefinition.java in  » UML » MetaBoss » com » metaboss » sdlctools » applications » anttasks » builder » modules » subelements » 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.applications.anttasks.builder.modules.subelements 
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.applications.anttasks.builder.modules.subelements;
016:
017:        import java.io.File;
018:        import java.util.ArrayList;
019:        import java.util.Arrays;
020:        import java.util.Iterator;
021:        import java.util.List;
022:
023:        import org.apache.tools.ant.BuildException;
024:
025:        import com.metaboss.enterprise.bs.BSException;
026:        import com.metaboss.sdlctools.applications.anttasks.builder.ModuleDefinition;
027:        import com.metaboss.sdlctools.applications.anttasks.builder.ModuleElementDefinition;
028:        import com.metaboss.sdlctools.applications.anttasks.builder.ToolInvocationDefinition;
029:        import com.metaboss.sdlctools.applications.anttasks.builder.tools.JavaCompilerInvocationDefinitionUtils;
030:        import com.metaboss.sdlctools.applications.anttasks.builder.tools.CoreCodeGeneratorInvocationDefinition;
031:        import com.metaboss.sdlctools.models.metabossmodel.ModelElement;
032:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.Enterprise;
033:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemimplementationmodel.Domain;
034:        import com.metaboss.sdlctools.services.codegeneration.CodeGenerationStylesheetAccessor;
035:        import com.metaboss.sdlctools.services.codegenerationstylesheet.STDomainStylesheet;
036:        import com.metaboss.util.StringUtils;
037:
038:        /** The definition of included storage implementation. */
039:        public class IncludeDomainImplementationDefinition extends
040:                ModuleElementDefinition {
041:            // Initialise metadata for supplying in the constructor
042:            private static ElementMetadata sElementMetadata = new ElementMetadata();
043:            static {
044:                sElementMetadata.ElementTypeName = "IncludeDomainImplementation";
045:                sElementMetadata.SupportsModelElementRefs = true;
046:                sElementMetadata.AllowedModelElementTypes = new Class[] {
047:                        Enterprise.class,
048:                        com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.System.class,
049:                        Domain.class, };
050:            }
051:            private List mDomainsToDo = new ArrayList();
052:
053:            /** The only available constructor */
054:            public IncludeDomainImplementationDefinition(
055:                    ModuleDefinition pOwnerModule) {
056:                super (pOwnerModule, sElementMetadata);
057:            }
058:
059:            /** Returns array of domains included in this definition */
060:            public Domain[] getIncludedDomains() {
061:                return (Domain[]) mDomainsToDo.toArray(new Domain[mDomainsToDo
062:                        .size()]);
063:            }
064:
065:            // Called when initialisation of parameters has been completed and generation is about to commence
066:            public void completeInitialisation() throws BuildException {
067:                // Work on included module elements
068:                ModelElement[] lIncludedModelElements = getIncludedModelElements();
069:                // First collect list of al domains to generate implementations for
070:                for (int lElementsIndex = 0; lElementsIndex < lIncludedModelElements.length; lElementsIndex++) {
071:                    ModelElement lIncludedModelElement = lIncludedModelElements[lElementsIndex];
072:                    mDomainsToDo.addAll(Arrays.asList(getOwnerTask()
073:                            .findModelElementsByXPath(lIncludedModelElement,
074:                                    "descendant-or-self::Domain",
075:                                    new Class[] { Domain.class })));
076:                }
077:            }
078:
079:            // Returns plan to invoke any number of code generators necessary to build the module  
080:            public ToolInvocationDefinition[] getGenerationPlan() {
081:                List lInvocations = new ArrayList();
082:                for (Iterator lDomainsIterator = mDomainsToDo.iterator(); lDomainsIterator
083:                        .hasNext();) {
084:                    Domain lDomain = (Domain) lDomainsIterator.next();
085:                    // Will need to generate core of the system this is where domain is
086:                    CoreCodeGeneratorInvocationDefinition lSystemCoreGeneratorInvocationDefinition = new CoreCodeGeneratorInvocationDefinition(
087:                            getOwnerTask());
088:                    lSystemCoreGeneratorInvocationDefinition
089:                            .setSystemRef(lDomain.getSystem().getRef());
090:                    lInvocations.add(lSystemCoreGeneratorInvocationDefinition);
091:                }
092:                // Return what we have		
093:                return (ToolInvocationDefinition[]) lInvocations
094:                        .toArray(new ToolInvocationDefinition[lInvocations
095:                                .size()]);
096:            }
097:
098:            // Returns tasks to do after generation. (Normally compillation would go in here  
099:            public ToolInvocationDefinition[] getCompilationPlan() {
100:                try {
101:                    List lInvocations = new ArrayList();
102:                    // Compile parts of the core
103:                    for (Iterator lDomainsIterator = mDomainsToDo.iterator(); lDomainsIterator
104:                            .hasNext();) {
105:                        Domain lDomain = (Domain) lDomainsIterator.next();
106:                        // Will need to compile enterprise types
107:                        lInvocations.add(JavaCompilerInvocationDefinitionUtils
108:                                .createForEnterpriseTypes(this , lDomain
109:                                        .getSystem().getEnterprise()));
110:                        // Will need to compile system types
111:                        lInvocations
112:                                .add(JavaCompilerInvocationDefinitionUtils
113:                                        .createForSystemTypes(this , lDomain
114:                                                .getSystem()));
115:                        // Domain interfaces
116:                        lInvocations.add(JavaCompilerInvocationDefinitionUtils
117:                                .createForDomainInterfaces(this , lDomain));
118:                        // Storage interfaces
119:                        lInvocations.add(JavaCompilerInvocationDefinitionUtils
120:                                .createForStorageInterfaces(this , lDomain));
121:                        // Domain implementations interfaces
122:                        lInvocations.add(JavaCompilerInvocationDefinitionUtils
123:                                .createForDomainImplementation(this , lDomain));
124:                    }
125:                    // Return what we have		
126:                    return (ToolInvocationDefinition[]) lInvocations
127:                            .toArray(new ToolInvocationDefinition[lInvocations
128:                                    .size()]);
129:                } catch (BSException e) {
130:                    throw new BuildException(
131:                            "Caught exception while generating packaging plan. "
132:                                    + e.getMessage());
133:                }
134:            }
135:
136:            /** Return tool invocations */
137:            public String[] getJarClassIncludes() throws BSException {
138:                List lJarClassIncludes = new ArrayList();
139:                // Compile parts of the core
140:                for (Iterator lDomainsIterator = mDomainsToDo.iterator(); lDomainsIterator
141:                        .hasNext();) {
142:                    Domain lDomain = (Domain) lDomainsIterator.next();
143:                    com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.System lSystem = lDomain
144:                            .getSystem();
145:                    STDomainStylesheet lDomainStylesheet = CodeGenerationStylesheetAccessor
146:                            .getDomainStylesheet(lDomain);
147:                    // Domain interfaces
148:                    String lDomainInterfacePackage = lDomainStylesheet
149:                            .getDomainPackageName();
150:                    String lDomainInterfaceSubdirectory = StringUtils.replace(
151:                            lDomainInterfacePackage, ".", File.separator);
152:                    lJarClassIncludes.add(lDomainInterfaceSubdirectory
153:                            + File.separator + "*.*");
154:                    // Domain implementations interfaces
155:                    String lDomainImplementationPackage = lDomainStylesheet
156:                            .getImplementationPackageName();
157:                    String lDomainImplementationSubdirectory = StringUtils
158:                            .replace(lDomainImplementationPackage, ".",
159:                                    File.separator);
160:                    lJarClassIncludes.add(lDomainImplementationSubdirectory
161:                            + File.separator + "*.*");
162:                }
163:                // Return what we have		
164:                return (String[]) lJarClassIncludes
165:                        .toArray(new String[lJarClassIncludes.size()]);
166:            }
167:        }
w___ww__.j_a_v___a_2_s_._co_m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.