private void publishConfiguration(SynapseConfiguration synCfg, Axis2SynapseEnvironment synEnv) {
int tenantId = SuperTenantCarbonContext.getCurrentContext(configurationContext).getTenantId();
SynapseRegistrationsService registrationsService =
ConfigHolder.getInstance().getSynapseRegistrationService(tenantId);
if (registrationsService != null) {
serverContextInformation.setSynapseConfiguration(synCfg);
// populate the Synapse Configuration
ServiceRegistration configRegistration =
registrationsService.getSynapseConfigurationServiceRegistration();
SynapseConfigurationService synCfgSvc = (SynapseConfigurationService)
ConfigHolder.getInstance().getBundleContext().getService(
configRegistration.getReference());
synCfgSvc.setSynapseConfiguration(synCfg);
configRegistration.setProperties(new Properties());
// populate the Synapse Environment
ServiceRegistration synEnvSvcRegistration =
registrationsService.getSynapseEnvironmentServiceRegistration();
SynapseEnvironmentService synEnvSvc = (SynapseEnvironmentService)
ConfigHolder.getInstance().getBundleContext().getService(
synEnvSvcRegistration.getReference());
synEnvSvc.setSynapseEnvironment(synEnv);
synEnvSvcRegistration.setProperties(new Properties());