Skip to content

Commit

Permalink
Notify observers when starting proxy services
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
auke- committed Aug 28, 2019
1 parent 11de73f commit 54b6b1f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
Expand Up @@ -475,28 +475,26 @@ public void stop() {
* @return SynapseEnvironment instance
*/
public SynapseEnvironment createSynapseEnvironment() {

try {
deploySynapseService();
deployProxyServices();
deployEventSources();
} catch (AxisFault axisFault) {
log.fatal("Synapse startup failed...", axisFault);
throw new SynapseException("Synapse startup failed", axisFault);
}

synapseEnvironment = new Axis2SynapseEnvironment(
configurationContext, synapseConfiguration, serverContextInformation);
configurationContext, synapseConfiguration, serverContextInformation);
MessageContextCreatorForAxis2.setSynEnv(synapseEnvironment);

Parameter synapseEnvironmentParameter = new Parameter(
SynapseConstants.SYNAPSE_ENV, synapseEnvironment);
SynapseConstants.SYNAPSE_ENV, synapseEnvironment);
try {
configurationContext.getAxisConfiguration().addParameter(synapseEnvironmentParameter);
} catch (AxisFault e) {
handleFatal("Could not set parameter '" + SynapseConstants.SYNAPSE_ENV +
"' to the Axis2 configuration : " + e.getMessage(), e);
"' to the Axis2 configuration : " + e.getMessage(), e);
}

try {
deploySynapseService();
deployProxyServices();
deployEventSources();
} catch (AxisFault axisFault) {
log.fatal("Synapse startup failed...", axisFault);
throw new SynapseException("Synapse startup failed", axisFault);
}

synapseEnvironment.getTaskManager().init(taskDescriptionRepository, taskScheduler);
Expand Down Expand Up @@ -778,7 +776,9 @@ private void deployProxyServices() {
configurationContext.getAxisConfiguration());
if (proxyService != null) {
log.info("Deployed Proxy service : " + proxy.getName());
if (!proxy.isStartOnLoad()) {
if (proxy.isStartOnLoad()) {
proxy.start(synapseConfiguration);
} else {
proxy.stop(synapseConfiguration);
}
} else {
Expand Down
Expand Up @@ -577,7 +577,6 @@ public AxisService buildAxisService(SynapseConfiguration synCfg, AxisConfigurati
axisCfg.addServiceToExistingServiceGroup(proxyService, serviceGroup);
}
}
this.setRunning(true);
} catch (AxisFault axisFault) {
try {
if (axisCfg.getService(proxyService.getName()) != null) {
Expand Down

0 comments on commit 54b6b1f

Please sign in to comment.