private void initPersistence( String configName, ConfigurationContext configurationContext, ServerContextInformation contextInfo) throws RegistryException, AxisFault { // Initialize the mediation persistence manager if required ServerConfiguration serverConf = ServerConfiguration.getInstance(); String persistence = serverConf.getFirstProperty(ServiceBusConstants.PERSISTENCE); org.wso2.carbon.registry.core.Registry configRegistry = (org.wso2.carbon.registry.core.Registry) SuperTenantCarbonContext.getCurrentContext(configurationContext) .getRegistry(RegistryType.SYSTEM_CONFIGURATION); // Check whether persistence is disabled if (!ServiceBusConstants.DISABLED.equals(persistence)) { // Check registry persistence is disabled or not String regPersistence = serverConf.getFirstProperty(ServiceBusConstants.REGISTRY_PERSISTENCE); UserRegistry registry = ServiceBusConstants.DISABLED.equals(regPersistence) ? null : (UserRegistry) configRegistry; // Check the worker interval is set or not String interval = serverConf.getFirstProperty(ServiceBusConstants.WORKER_INTERVAL); long intervalInMillis = 5000L; if (interval != null && !"".equals(interval)) { try { intervalInMillis = Long.parseLong(interval); } catch (NumberFormatException e) { log.error( "Invalid value " + interval + " specified for the mediation " + "persistence worker interval, Using defaults", e); } } MediationPersistenceManager pm = new MediationPersistenceManager( registry, contextInfo.getServerConfigurationInformation().getSynapseXMLLocation(), contextInfo.getSynapseConfiguration(), intervalInMillis, configName); configurationContext .getAxisConfiguration() .addParameter(new Parameter(ServiceBusConstants.PERSISTENCE_MANAGER, pm)); } else { log.info("Persistence for mediation configuration is disabled"); } }