Source Code Cross Referenced for StandaloneMigrationLauncher.java in  » Project-Management » XPlanner-0.7b7 » com » tacitknowledge » util » migration » jdbc » 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 » Project Management » XPlanner 0.7b7 » com.tacitknowledge.util.migration.jdbc 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 2006 Your Corporation. All Rights Reserved.
003:         */
004:
005:        /*
006:         * Created by IntelliJ IDEA.
007:         * User: Jacques
008:         * Date: Feb 25, 2006
009:         * Time: 11:49:15 PM
010:         */
011:        package com.tacitknowledge.util.migration.jdbc;
012:
013:        import java.util.Properties;
014:
015:        import org.apache.commons.logging.Log;
016:        import org.apache.commons.logging.LogFactory;
017:
018:        /**
019:         * Launches the migration process as a standalone application.
020:         * <p>
021:         * This class expects the following Java environment parameters:
022:         * <ul>
023:         *    <li>migration.systemname - the name of the logical system being migrated</li>
024:         * </ul>
025:         * <p>
026:         * Below is an example of how this class can be configured in build.xml:
027:         * <pre>
028:         *   ...
029:         *  &lt;target name="patch.database" description="Runs the migration system"&gt;
030:         *   &lt;java
031:         *       fork="true"
032:         *       classpathref="patch.classpath"
033:         *       failonerror="true"
034:         *       classname="com.tacitknowledge.util.migration.jdbc.StandaloneMigrationLauncher"&gt;
035:         *     &lt;sysproperty key="migration.systemname" value="${application.name}"/&gt;
036:         *   &lt;/java&gt;
037:         * &lt;/target&gt;
038:         *   ...
039:         * </pre>
040:         *
041:         * @author  Mike Hardy (mike@tacitknowledge.com)
042:         * @version $Id: StandaloneMigrationLauncher.java,v 1.7 2005/09/07 22:20:34 chrisa Exp $
043:         * @see     com.tacitknowledge.util.migration.MigrationProcess
044:         */
045:        public class StandaloneMigrationLauncher {
046:            /**
047:             * Class logger
048:             */
049:            private static Log log = LogFactory
050:                    .getLog(StandaloneMigrationLauncher.class);
051:
052:            /**
053:             * Private constructor - this object shouldn't be instantiated
054:             */
055:            private StandaloneMigrationLauncher() {
056:                // does nothing
057:            }
058:
059:            /**
060:             * Run the migrations for the given system name
061:             *
062:             * @param arguments the command line arguments, if any (none are used)
063:             * @exception Exception if anything goes wrong
064:             */
065:            public static void main(String[] arguments) throws Exception {
066:                String systemName = getRequiredParam("migration.systemname",
067:                        System.getProperties(), arguments);
068:
069:                // The MigrationLauncher is responsible for handling the interaction
070:                // between the PatchTable and the underlying MigrationTasks; as each
071:                // task is executed, the patch level is incremented, etc.
072:                try {
073:                    JdbcMigrationLauncherFactory launcherFactory = MigrationLauncherFactoryLoader
074:                            .createFactory();
075:                    JdbcMigrationLauncher launcher = launcherFactory
076:                            .createMigrationLauncher(systemName);
077:                    launcher.doMigrations();
078:                } catch (Exception e) {
079:                    log.error(e);
080:                    throw e;
081:                }
082:            }
083:
084:            /**
085:             * Returns the value of the specified servlet context initialization parameter.
086:             *
087:             * @param  param the parameter to return
088:             * @param  properties the <code>Properties</code> for the Java system
089:             * @param  arguments optionally takes the arguments passed into the main to
090:             * use as the migration system name
091:             * @return the value of the specified system initialization parameter
092:             * @throws IllegalArgumentException if the parameter does not exist
093:             */
094:            private static String getRequiredParam(String param,
095:                    Properties properties, String[] arguments)
096:                    throws IllegalArgumentException {
097:                String value = properties.getProperty(param);
098:                if (value == null) {
099:                    if ((arguments != null) && (arguments.length > 0)) {
100:                        value = arguments[0].trim();
101:                    } else {
102:                        throw new IllegalArgumentException("'" + param
103:                                + "' is a required "
104:                                + "initialization parameter.  Aborting.");
105:                    }
106:                }
107:                return value;
108:            }
109:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.