use of com.helger.phoss.smp.backend.SMPBackendRegistry in project phoss-smp by phax.
the class SMPMetaManager method initBackendFromConfiguration.
/**
* This is the initialization routine that must be called upon application
* startup. It performs the SPI initialization of all registered manager
* provider ({@link ISMPManagerProvider}) and selects the one specified in the
* SMP server configuration file.
*
* @throws InitializationException
* If an unsupported backend is provided in the configuration.
* @see SMPServerConfiguration#getBackend()
* @see SMPBackendRegistry
* @see ISMPManagerProvider
* @see #setManagerProvider(ISMPManagerProvider)
*/
public static void initBackendFromConfiguration() {
// Determine backend
final SMPBackendRegistry aBackendRegistry = SMPBackendRegistry.getInstance();
final String sBackendID = SMPServerConfiguration.getBackend();
LOGGER.info("Initializing SMP manager for backend '" + sBackendID + "'");
final ISMPManagerProvider aManagerProvider = aBackendRegistry.getManagerProvider(sBackendID);
if (aManagerProvider == null)
throw new InitializationException("Invalid backend '" + sBackendID + "' provided. Supported ones are: " + aBackendRegistry.getAllBackendIDs());
// Remember the manager provider
setManagerProvider(aManagerProvider);
// Now we can call getInstance to ensure everything is initialized correctly
getInstance();
}
Aggregations