Source Code Cross Referenced for AdapterGeneratorInvocationDefinition.java in  » UML » MetaBoss » com » metaboss » sdlctools » applications » anttasks » builder » tools » 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.tools 
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.tools;
016:
017:        import org.apache.tools.ant.BuildException;
018:
019:        import com.metaboss.enterprise.bs.BSException;
020:        import com.metaboss.sdlctools.applications.anttasks.builder.MetaBossBuilderTask;
021:        import com.metaboss.sdlctools.applications.anttasks.builder.ToolInvocationDefinition;
022:        import com.metaboss.sdlctools.services.codegeneration.BSAdapterGenerator;
023:        import com.metaboss.util.ObjectUtils;
024:
025:        /** This definition is responsible for invocation of the SystemCore generator */
026:        public class AdapterGeneratorInvocationDefinition extends
027:                ToolInvocationDefinition {
028:            private String mServicemoduleRef = null;
029:            private String mDataDictionaryRef = null;
030:            private String mType = null;
031:            private BSAdapterGenerator mGenerator = null;
032:
033:            /** Public constructor for the invocation */
034:            public AdapterGeneratorInvocationDefinition(
035:                    MetaBossBuilderTask pOwnerTask) {
036:                super (pOwnerTask, "Generate adapter code for the servicemodule");
037:            }
038:
039:            // Override to return better description if possible
040:            public String getToolInvocationName() {
041:                if (mType != null && mServicemoduleRef != null)
042:                    return "Generate " + getType() + " adapter code for the "
043:                            + getServicemoduleRef() + " servicemodule";
044:                else if (mType != null && mDataDictionaryRef != null)
045:                    return "Generate " + getType() + " adapter code for the "
046:                            + getDataDictionaryRef() + " data dictionary";
047:                return super .getToolInvocationName();
048:            }
049:
050:            /** Setter for the ServicemoduleRef attribute */
051:            public void setServicemoduleRef(String pServicemoduleRef) {
052:                mServicemoduleRef = pServicemoduleRef;
053:            }
054:
055:            /** Setter for the DataDictionaryRef attribute */
056:            public void setDataDictionaryRef(String pDataDictionaryRef) {
057:                mDataDictionaryRef = pDataDictionaryRef;
058:            }
059:
060:            /** Getter for the ServicemoduleRef attribute */
061:            public String getServicemoduleRef() {
062:                return mServicemoduleRef;
063:            }
064:
065:            /** Getter for the DataDictionaryRef attribute */
066:            public String getDataDictionaryRef() {
067:                return mDataDictionaryRef;
068:            }
069:
070:            /** Setter for the Type attribute */
071:            public void setType(String pType) {
072:                mType = pType;
073:            }
074:
075:            /** Getter for the Type attribute */
076:            public String getType() {
077:                if (mType == null)
078:                    throw new BuildException(
079:                            "Missing 'Type' attribute, which is mandatory for generator invocation.");
080:                return mType;
081:            }
082:
083:            /** Setter for the Generator */
084:            public void setGenerator(BSAdapterGenerator pGenerator) {
085:                mGenerator = pGenerator;
086:            }
087:
088:            /** Getter for the Generator */
089:            public BSAdapterGenerator getGenerator() {
090:                if (mGenerator == null)
091:                    throw new BuildException(
092:                            "Missing Generator service, which is mandatory for generation.");
093:                return mGenerator;
094:            }
095:
096:            /** Overridden to compare details of the invocation */
097:            public boolean equals(Object pOther) {
098:                if (this  == pOther)
099:                    return true;
100:                if (pOther instanceof  AdapterGeneratorInvocationDefinition) {
101:                    AdapterGeneratorInvocationDefinition lOther = (AdapterGeneratorInvocationDefinition) pOther;
102:                    if (ObjectUtils.equals(getServicemoduleRef(), lOther
103:                            .getServicemoduleRef())
104:                            && ObjectUtils.equals(getDataDictionaryRef(),
105:                                    lOther.getDataDictionaryRef())
106:                            && ObjectUtils.equals(getType(), lOther.getType()))
107:                        return true;
108:                }
109:                return false;
110:            }
111:
112:            /** This method will have to invoke the generator */
113:            public void invoke() throws BuildException {
114:                // Allow to look for the data type classes in the destination class ditectory
115:                String lOriginalProperty = System
116:                        .setProperty(
117:                                "com.metaboss.sdlctools.services.codegenerationstylesheet.BSCodeGenerationStylesheet.datatypeclasspath",
118:                                getOwnerTask().getClassDir().getAbsolutePath());
119:                // Run inprocess
120:                try {
121:                    if (getServicemoduleRef() != null)
122:                        getGenerator().generateSourceCodeForServicemodule(
123:                                getOwnerTask().getGenDir().getAbsolutePath(),
124:                                getServicemoduleRef());
125:                    else if (getDataDictionaryRef() != null)
126:                        getGenerator().generateSourceCodeForDataDictionary(
127:                                getOwnerTask().getGenDir().getAbsolutePath(),
128:                                getDataDictionaryRef());
129:                    else
130:                        throw new BuildException(
131:                                "Missing either 'ServicemoduleRef' or 'DataDictionaryRef' attribute. One and only one of them must be defined for generator invocation.");
132:                } catch (BSException e) {
133:                    throw new BuildException(
134:                            "Unable to run generator for the adapter. Caught BSException: "
135:                                    + e.getMessage());
136:                } finally {
137:                    if (lOriginalProperty != null)
138:                        System
139:                                .setProperty(
140:                                        "com.metaboss.sdlctools.services.codegenerationstylesheet.BSCodeGenerationStylesheet.datatypeclasspath",
141:                                        lOriginalProperty);
142:                    else
143:                        System
144:                                .getProperties()
145:                                .remove(
146:                                        "com.metaboss.sdlctools.services.codegenerationstylesheet.BSCodeGenerationStylesheet.datatypeclasspath");
147:                }
148:            }
149:        }
w___ww_._j_a__v__a2__s.__com_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.