use of org.alfresco.service.cmr.admin.RepoUsage.LicenseMode in project records-management by Alfresco.
the class ModuleCompatibilityComponent method onApplicationEvent.
/**
* @see org.springframework.context.ApplicationListener#onApplicationEvent(org.springframework.context.ApplicationEvent)
*/
@Override
public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
// license mode
LicenseMode licenseMode = LicenseMode.UNKNOWN;
// grab the application context
ApplicationContext applicationContext = contextRefreshedEvent.getApplicationContext();
// get the license mode
LicenseDescriptor license = descriptorService.getLicenseDescriptor();
if (license != null) {
licenseMode = license.getLicenseMode();
}
// determine whether RM Enterprise is installed or not
boolean isRMEnterprise = isRMEnterprise();
// debug log
if (logger.isDebugEnabled()) {
logger.debug("Module compatibility information:");
logger.debug(" Repository licence mode = " + licenseMode.toString());
logger.debug(" RM Enterprise installed = " + isRMEnterprise);
}
if (LicenseMode.ENTERPRISE.equals(licenseMode) && !isRMEnterprise) {
// running enterprise rm on community core so close application
// context
closeApplicationContext(applicationContext, "Running Community Records Management Module on Enterprise Alfresco One is not a supported configuration.");
} else if (!LicenseMode.ENTERPRISE.equals(licenseMode) && isRMEnterprise) {
// running community rm on enterprise core so close application
// context
closeApplicationContext(applicationContext, "Running Enterprise Records Management module on Community Alfresco One is not a supported configuration.");
}
}
Aggregations