in data-catalog-api/server/service/src/main/java/org/apache/airavata/datacatalog/api/DataCatalogApiServiceApplication.java [33:49]
public SharingManager getSharingManager(
@Value("${sharing.manager.class.name:org.apache.airavata.datacatalog.api.sharing.SimpleSharingManagerImpl}") String sharingManagerClassName) {
try {
Class<?> sharingManagerClass = (Class<?>) Class.forName(sharingManagerClassName);
Constructor<?> constructor = sharingManagerClass.getConstructor();
try {
return (SharingManager) constructor.newInstance();
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
| InvocationTargetException e) {
throw new RuntimeException("Failed to instantiated sharing manager " + sharingManagerClass, e);
}
} catch (ClassNotFoundException e) {
throw new RuntimeException("Unable to load the sharing manager class " + sharingManagerClassName, e);
} catch (NoSuchMethodException | SecurityException e) {
throw new RuntimeException("Failed to find no-arg constructor for " + sharingManagerClassName, e);
}
}