Skip to content

Commit 54b6b1f

Browse files
committed
Notify observers when starting proxy services
When a proxy service is started the Axis2 Observers aren't notified. This is due to the fact that the proxy services are only loaded by the Axis2 Synapse controller and not started. Inline in, out and fault sequences are not initialized, since that happens when a service is started. By starting the proxy services explicitly in the Axis2 Synapse controller the sequences are properly initialized and the Axis2 Observers are notified.
1 parent 11de73f commit 54b6b1f

2 files changed

Lines changed: 14 additions & 15 deletions

File tree

modules/core/src/main/java/org/apache/synapse/Axis2SynapseController.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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 {

modules/core/src/main/java/org/apache/synapse/core/axis2/ProxyService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,6 @@ public AxisService buildAxisService(SynapseConfiguration synCfg, AxisConfigurati
577577
axisCfg.addServiceToExistingServiceGroup(proxyService, serviceGroup);
578578
}
579579
}
580-
this.setRunning(true);
581580
} catch (AxisFault axisFault) {
582581
try {
583582
if (axisCfg.getService(proxyService.getName()) != null) {

0 commit comments

Comments
 (0)