Source Code Cross Referenced for AbstractAndroMDAMojo.java in  » UML » AndroMDA-3.2 » org » andromda » maven » plugin » 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 » AndroMDA 3.2 » org.andromda.maven.plugin 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.andromda.maven.plugin;
002:
003:        import java.io.FileNotFoundException;
004:        import java.net.MalformedURLException;
005:        import java.net.URL;
006:        import java.util.List;
007:
008:        import org.andromda.core.common.AndroMDALogger;
009:        import org.andromda.core.common.ExceptionUtils;
010:        import org.andromda.core.common.ResourceUtils;
011:        import org.andromda.core.configuration.Configuration;
012:        import org.andromda.maven.plugin.configuration.AbstractConfigurationMojo;
013:        import org.apache.maven.artifact.Artifact;
014:        import org.apache.maven.artifact.factory.ArtifactFactory;
015:        import org.apache.maven.artifact.repository.ArtifactRepository;
016:        import org.apache.maven.plugin.MojoExecutionException;
017:        import org.apache.maven.plugin.MojoFailureException;
018:        import org.apache.maven.project.MavenProject;
019:        import org.apache.maven.settings.Settings;
020:
021:        /**
022:         * The abstract AndroMDA Mojo.  This should be extended
023:         * by the Mojos that are used to run AndroMDA.
024:         *
025:         * @author Chad Brandon
026:         */
027:        public abstract class AbstractAndroMDAMojo extends
028:                AbstractConfigurationMojo {
029:            /**
030:             * This is the URI to the AndroMDA configuration file.
031:             *
032:             * @parameter expression="file:${project.basedir}/conf/andromda.xml"
033:             * @required
034:             */
035:            protected String configurationUri;
036:
037:            /**
038:             * @parameter expression="${project}"
039:             * @required
040:             * @readonly
041:             */
042:            protected MavenProject project;
043:
044:            /**
045:             * @parameter expression="${project.build.filters}"
046:             */
047:            protected List propertyFiles;
048:
049:            /**
050:             * The current user system settings for use in Maven. (allows us to pass the user
051:             * settings to the AndroMDA configuration).
052:             *
053:             * @parameter expression="${settings}"
054:             * @required
055:             * @readonly
056:             */
057:            protected Settings settings;
058:
059:            /**
060:             * @parameter expression="${component.org.apache.maven.artifact.factory.ArtifactFactory}"
061:             * @required
062:             * @readonly
063:             */
064:            protected ArtifactFactory factory;
065:
066:            /**
067:             * The registered plugin implementations.
068:             *
069:             * @parameter expression="${project.build.plugins}"
070:             * @required
071:             * @readonlya
072:             */
073:            protected List plugins;
074:
075:            /**
076:             * @parameter expression="${localRepository}"
077:             * @required
078:             * @readonly
079:             */
080:            protected ArtifactRepository localRepository;
081:
082:            /**
083:             * @see org.apache.maven.plugin.Mojo#execute()
084:             */
085:            public void execute() throws MojoExecutionException,
086:                    MojoFailureException {
087:                try {
088:                    AndroMDALogger.initialize();
089:                    final URL configurationUri = ResourceUtils
090:                            .toURL(this .configurationUri);
091:                    if (configurationUri == null) {
092:                        throw new MojoExecutionException(
093:                                "Configuration could not be loaded from '"
094:                                        + this .configurationUri + "'");
095:                    }
096:
097:                    // - setup the classpath
098:                    this .addPluginDependencies(Constants.ARTIFACT_ID,
099:                            Artifact.SCOPE_RUNTIME);
100:                    this .initializeClasspathFromClassPathElements(this .project
101:                            .getRuntimeClasspathElements());
102:                    final Configuration configuration = this 
103:                            .getConfiguration(configurationUri);
104:                    this .execute(configuration);
105:                } catch (Throwable throwable) {
106:                    String message = "Error running AndroMDA";
107:                    throwable = ExceptionUtils.getRootCause(throwable);
108:                    if (throwable instanceof  MalformedURLException
109:                            || throwable instanceof  FileNotFoundException) {
110:                        message = "Configuration is not valid '"
111:                                + this .configurationUri + "'";
112:                    }
113:                    throw new MojoExecutionException(message, throwable);
114:                }
115:            }
116:
117:            /**
118:             * Performs the execution of an AndroMDA service with the given 
119:             * <code>configuration</code>.
120:             * 
121:             * @param configuration the configuration to use for AndroMDA service execution
122:             */
123:            protected abstract void execute(final Configuration configuration)
124:                    throws Exception;
125:
126:            /**
127:             * @param configurationUri The configurationUri to set.
128:             */
129:            public void setConfigurationUri(String configurationUri) {
130:                this .configurationUri = configurationUri;
131:            }
132:
133:            /**
134:             * @param project The project to set.
135:             */
136:            public void setProject(MavenProject project) {
137:                this .project = project;
138:            }
139:
140:            /**
141:             * Sets the current settings for this Mojo.
142:             *
143:             * @param settings The settings to set.
144:             */
145:            public void setSettings(Settings settings) {
146:                this .settings = settings;
147:            }
148:
149:            /**
150:             * Sets the property files for this project.
151:             *
152:             * @param propertyFiles
153:             */
154:            public void setPropertyFiles(List propertyFiles) {
155:                this .propertyFiles = propertyFiles;
156:            }
157:
158:            /**
159:             * @see org.andromda.maven.plugin.configuration.AbstractConfigurationMojo#getProject()
160:             */
161:            protected MavenProject getProject() {
162:                return this .project;
163:            }
164:
165:            /**
166:             * @see org.andromda.maven.plugin.configuration.AbstractConfigurationMojo#getPropertyFiles()
167:             */
168:            protected List getPropertyFiles() {
169:                return this .propertyFiles;
170:            }
171:
172:            /**
173:             * @see org.andromda.maven.plugin.configuration.AbstractConfigurationMojo#getSettings()
174:             */
175:            protected Settings getSettings() {
176:                return this .settings;
177:            }
178:
179:            /**
180:             * @see org.andromda.maven.plugin.configuration.AbstractConfigurationMojo#getFactory()
181:             */
182:            protected ArtifactFactory getFactory() {
183:                return this .factory;
184:            }
185:
186:            /**
187:             * @see org.andromda.maven.plugin.configuration.AbstractConfigurationMojo#getPlugins()
188:             */
189:            protected List getPlugins() {
190:                return this .plugins;
191:            }
192:
193:            /**
194:             * @see org.andromda.maven.plugin.configuration.AbstractConfigurationMojo#getLocalRepository()
195:             */
196:            protected ArtifactRepository getLocalRepository() {
197:                return this.localRepository;
198:            }
199:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.