@@ -475,28 +475,26 @@ public void stop() {
475475 * @return SynapseEnvironment instance
476476 */
477477 public SynapseEnvironment createSynapseEnvironment () {
478-
479- try {
480- deploySynapseService ();
481- deployProxyServices ();
482- deployEventSources ();
483- } catch (AxisFault axisFault ) {
484- log .fatal ("Synapse startup failed..." , axisFault );
485- throw new SynapseException ("Synapse startup failed" , axisFault );
486- }
487-
488478 synapseEnvironment = new Axis2SynapseEnvironment (
489- configurationContext , synapseConfiguration , serverContextInformation );
479+ configurationContext , synapseConfiguration , serverContextInformation );
490480 MessageContextCreatorForAxis2 .setSynEnv (synapseEnvironment );
491481
492482 Parameter synapseEnvironmentParameter = new Parameter (
493- SynapseConstants .SYNAPSE_ENV , synapseEnvironment );
483+ SynapseConstants .SYNAPSE_ENV , synapseEnvironment );
494484 try {
495485 configurationContext .getAxisConfiguration ().addParameter (synapseEnvironmentParameter );
496486 } catch (AxisFault e ) {
497487 handleFatal ("Could not set parameter '" + SynapseConstants .SYNAPSE_ENV +
498- "' to the Axis2 configuration : " + e .getMessage (), e );
488+ "' to the Axis2 configuration : " + e .getMessage (), e );
489+ }
499490
491+ try {
492+ deploySynapseService ();
493+ deployProxyServices ();
494+ deployEventSources ();
495+ } catch (AxisFault axisFault ) {
496+ log .fatal ("Synapse startup failed..." , axisFault );
497+ throw new SynapseException ("Synapse startup failed" , axisFault );
500498 }
501499
502500 synapseEnvironment .getTaskManager ().init (taskDescriptionRepository , taskScheduler );
@@ -778,7 +776,9 @@ private void deployProxyServices() {
778776 configurationContext .getAxisConfiguration ());
779777 if (proxyService != null ) {
780778 log .info ("Deployed Proxy service : " + proxy .getName ());
781- if (!proxy .isStartOnLoad ()) {
779+ if (proxy .isStartOnLoad ()) {
780+ proxy .start (synapseConfiguration );
781+ } else {
782782 proxy .stop (synapseConfiguration );
783783 }
784784 } else {
0 commit comments