use of org.nhindirect.gateway.smtp.provider.MailetAwareProvider in project nhin-d by DirectProject.
the class NHINDSecurityAndTrustMailet method getServiceSecurityManagerProvider.
/**
* Gets a custom service security manager provider. If this is null, the system will us a default provider.
* @return Gets a service security manager provider.
*/
protected Provider<ServiceSecurityManager> getServiceSecurityManagerProvider() {
Provider<ServiceSecurityManager> retVal = null;
String providerClazz = GatewayConfiguration.getConfigurationParam(SecurityAndTrustMailetOptions.SERVICE_SECURITY_MANAGER_PROVIDER, this, "");
if (providerClazz != null && !providerClazz.isEmpty()) {
try {
// create an instance of the provider
@SuppressWarnings("unchecked") Class<Provider<ServiceSecurityManager>> clazz = (Class<Provider<ServiceSecurityManager>>) getClass().getClassLoader().loadClass(providerClazz);
retVal = clazz.newInstance();
} catch (Exception e) {
LOGGER.warn("Failed to load service security manager provider class " + providerClazz + ": " + e.getMessage(), e);
retVal = new OpenServiceSecurityManagerProvider();
}
} else {
retVal = new OpenServiceSecurityManagerProvider();
}
if (retVal instanceof MailetAwareProvider)
((MailetAwareProvider) retVal).setMailet(this);
return retVal;
}
Aggregations