Author: ruwan Date: Mon Dec 1 02:39:56 2008 New Revision: 25359 URL: http://wso2.org/svn/browse/wso2?view=rev&revision=25359
Log: Ability to run sample configurations Modified: trunk/esb/java/modules/core/pom.xml trunk/esb/java/modules/core/src/main/java/org/wso2/esb/core/ESBActivator.java Modified: trunk/esb/java/modules/core/pom.xml URL: http://wso2.org/svn/browse/wso2/trunk/esb/java/modules/core/pom.xml?rev=25359&r1=25358&r2=25359&view=diff ============================================================================== --- trunk/esb/java/modules/core/pom.xml (original) +++ trunk/esb/java/modules/core/pom.xml Mon Dec 1 02:39:56 2008 @@ -115,7 +115,7 @@ <Bundle-Name>${pom.artifactId}</Bundle-Name> <Bundle-Version>1.0.0</Bundle-Version> <Bundle-Activator>org.wso2.esb.core.ESBActivator</Bundle-Activator> - <WSO2-Bundle-StartLevel>90</WSO2-Bundle-StartLevel> + <WSO2-Bundle-StartLevel>65</WSO2-Bundle-StartLevel> <Export-Package> org.wso2.esb.core.*; version=1.0.0, </Export-Package> Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/core/ESBActivator.java URL: http://wso2.org/svn/browse/wso2/trunk/esb/java/modules/core/src/main/java/org/wso2/esb/core/ESBActivator.java?rev=25359&r1=25358&r2=25359&view=diff ============================================================================== --- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/core/ESBActivator.java (original) +++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/core/ESBActivator.java Mon Dec 1 02:39:56 2008 @@ -3,14 +3,16 @@ import org.apache.axis2.context.ConfigurationContext; import org.apache.axis2.description.Parameter; import org.apache.axis2.engine.AxisConfiguration; +import org.apache.synapse.ServerManager; import org.apache.synapse.Startup; import org.apache.synapse.SynapseConstants; -import org.apache.synapse.SynapseException; import org.apache.synapse.config.SynapseConfiguration; import org.apache.synapse.core.SynapseEnvironment; import org.osgi.framework.*; import org.wso2.carbon.utils.ConfigurationContextService; +import java.io.File; + /** * */ @@ -20,14 +22,25 @@ public void start(BundleContext bundleContext) throws Exception { this.bundleContext = bundleContext; - initESB(); + bundleContext.addBundleListener(this); + if (System.getProperty("esb.sample") != null) { + String carbonHome; + if ((carbonHome = System.getProperty("carbon.home")).equals(".")) { + carbonHome = new File(".").getAbsolutePath(); + } + ServerManager.getInstance().setSynapseHome(carbonHome); + ServerManager.getInstance().setSynapseXMLPath("repository" + File.separator + + "samples" + File.separator + "synapse_sample_" + + System.getProperty("esb.sample") + ".xml"); + } } public void stop(BundleContext bundleContext) throws Exception { + bundleContext.removeBundleListener(this); } public void bundleChanged(BundleEvent event) { - + if (!event.getBundle().getSymbolicName().equals("org.wso2.carbon.core")) { return; } _______________________________________________ Esb-java-dev mailing list [email protected] https://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev
