You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by ru...@apache.org on 2010/11/21 17:15:22 UTC
svn commit: r1037496 - in /synapse/branches/2.0/modules:
distribution/src/main/bin/synapse-config-migrator.sh
distribution/src/main/bin/synapse.sh
migrator/src/main/java/org/apache/synapse/migrator/ConfigurationMigrator.java
Author: ruwan
Date: Sun Nov 21 16:15:22 2010
New Revision: 1037496
URL: http://svn.apache.org/viewvc?rev=1037496&view=rev
Log:
Fixing the migrator
Modified:
synapse/branches/2.0/modules/distribution/src/main/bin/synapse-config-migrator.sh
synapse/branches/2.0/modules/distribution/src/main/bin/synapse.sh
synapse/branches/2.0/modules/migrator/src/main/java/org/apache/synapse/migrator/ConfigurationMigrator.java
Modified: synapse/branches/2.0/modules/distribution/src/main/bin/synapse-config-migrator.sh
URL: http://svn.apache.org/viewvc/synapse/branches/2.0/modules/distribution/src/main/bin/synapse-config-migrator.sh?rev=1037496&r1=1037495&r2=1037496&view=diff
==============================================================================
--- synapse/branches/2.0/modules/distribution/src/main/bin/synapse-config-migrator.sh (original)
+++ synapse/branches/2.0/modules/distribution/src/main/bin/synapse-config-migrator.sh Sun Nov 21 16:15:22 2010
@@ -19,7 +19,7 @@
# -----------------------------------------------------------------------------
#
-# Environment Variable Prequisites
+# Environment Variable Prerequisites
#
# SYNAPSE_HOME Home of Synapse installation. If not set will use the parent directory
#
@@ -29,7 +29,7 @@
# if JAVA_HOME is not set we're not happy
if [ -z "$JAVA_HOME" ]; then
- echo "You must set the JAVA_HOME variable before running Synapse."
+ echo "You must set the JAVA_HOME variable before running Synapse Configuration Migrator."
exit 1
fi
@@ -107,14 +107,26 @@ fi
# endorsed dir
SYNAPSE_ENDORSED=$SYNAPSE_HOME/lib/endorsed
+MIGRATING_CONFIG=$SYNAPSE_HOME/repository/conf/synapse.xml
+if [ ! $1 == '' ]; then
+ MIGRATING_CONFIG=$1
+fi
+
# ----- Execute The Requested Command -----------------------------------------
cd $SYNAPSE_HOME
-echo "Starting Synapse/Java ..."
-echo "Using SYNAPSE_HOME: $SYNAPSE_HOME"
-echo "Using JAVA_HOME: $JAVA_HOME"
-echo "Using SYNAPSE_XML: $SYNAPSE_XML"
+echo ""
+echo " ##############################################"
+echo " # Synapse Configuration Migration #"
+echo " ##############################################"
+echo ""
+echo "Using SYNAPSE_HOME : $SYNAPSE_HOME"
+echo "Using JAVA_HOME : $JAVA_HOME"
+echo "Migrating configuration : $MIGRATING_CONFIG"
+
+echo "Backing up the configuration file to $MIGRATING_CONFIG.back"
+cp $MIGRATING_CONFIG $MIGRATING_CONFIG.back
$JAVA_HOME/bin/java -server -Xms128M -Xmx128M \
$TEMP_PROPS \
@@ -123,6 +135,9 @@ $JAVA_HOME/bin/java -server -Xms128M -Xm
-Djava.io.tmpdir=$SYNAPSE_HOME/work/temp/synapse \
-classpath $SYNAPSE_CLASSPATH \
org.apache.synapse.migrator.ConfigurationMigrator \
- $1 \
- $SYNAPSE_HOME/repository/conf/migrated-synapse.xml \
- $SYNAPSE_HOME/resources/synapse-configuration-migrator.xslt \
+ $MIGRATING_CONFIG \
+ $MIGRATING_CONFIG.new \
+ $SYNAPSE_HOME/resources/synapse-configuration-migrator.xslt
+
+echo "Renaming the migrated configuration to the original one"
+mv $MIGRATING_CONFIG.new $MIGRATING_CONFIG
Modified: synapse/branches/2.0/modules/distribution/src/main/bin/synapse.sh
URL: http://svn.apache.org/viewvc/synapse/branches/2.0/modules/distribution/src/main/bin/synapse.sh?rev=1037496&r1=1037495&r2=1037496&view=diff
==============================================================================
--- synapse/branches/2.0/modules/distribution/src/main/bin/synapse.sh (original)
+++ synapse/branches/2.0/modules/distribution/src/main/bin/synapse.sh Sun Nov 21 16:15:22 2010
@@ -19,7 +19,7 @@
# -----------------------------------------------------------------------------
#
-# Environment Variable Prequisites
+# Environment Variable Prerequisites
#
# SYNAPSE_HOME Home of Synapse installation. If not set will use the parent directory
#
Modified: synapse/branches/2.0/modules/migrator/src/main/java/org/apache/synapse/migrator/ConfigurationMigrator.java
URL: http://svn.apache.org/viewvc/synapse/branches/2.0/modules/migrator/src/main/java/org/apache/synapse/migrator/ConfigurationMigrator.java?rev=1037496&r1=1037495&r2=1037496&view=diff
==============================================================================
--- synapse/branches/2.0/modules/migrator/src/main/java/org/apache/synapse/migrator/ConfigurationMigrator.java (original)
+++ synapse/branches/2.0/modules/migrator/src/main/java/org/apache/synapse/migrator/ConfigurationMigrator.java Sun Nov 21 16:15:22 2010
@@ -57,10 +57,6 @@ public class ConfigurationMigrator {
public static void main(String[] arguments) {
- System.out.println("\n\t#######################################################");
- System.out.println("\t# Apache Synapse - Configuration Migration #");
- System.out.println("\t#######################################################");
-
System.out.println("\n[INFO] Migration STARTED");
try {