if (AxisEvent.SERVICE_DEPLOY == event.getEventType()) {
ProxyService proxySvc = synapseConfig.getProxyService(axisService.getName());
if (proxySvc != null) {
try {
ServicePersistenceManager spm = new ServicePersistenceManager(
synapseConfig.getAxisConfiguration());
for (Parameter p : axisService.getParameters()) {
spm.updateServiceParameter(axisService, p);
}
} catch (Exception e) {
}
}
}
if (AxisEvent.SERVICE_REMOVE == event.getEventType()) {
Parameter keepServiceHistoryParam = axisService.getParameter(
CarbonConstants.KEEP_SERVICE_HISTORY_PARAM);
boolean keepHistory = keepServiceHistoryParam != null
&& JavaUtils.isTrue(keepServiceHistoryParam.getValue());
if (!keepHistory) {
ProxyService proxySvc = synapseConfig.getProxyService(axisService.getName());
if (proxySvc != null) {
synapseConfig.removeProxyService(axisService.getName());
MediationPersistenceManager pm = getMediationPersistenceManager();
pm.deleteItem(proxySvc.getName(), proxySvc.getFileName(),
ServiceBusConstants.ITEM_TYPE_PROXY_SERVICE);
log.info("Deleted the proxy service : " + proxySvc.getName());
} else if (log.isDebugEnabled()) {
log.debug("Proxy Service representing the service " + axisService.getName()
+ " of type proxy is not found in the SynapseConfiguration");
}
} else {
try {
ServicePersistenceManager spm = new ServicePersistenceManager(
synapseConfig.getAxisConfiguration());
for (Parameter p : axisService.getParameters()) {
spm.removeServiceParameter(axisService, p);
}
} catch (Exception e) {
log.warn("Error while removing service parameter information from registry", e);
}
}