use of com.accenture.trac.common.exception.EPluginNotAvailable in project tracdap by finos.
the class PluginManager method createService.
@Override
public <T> T createService(Class<T> serviceClass, String protocol, Properties properties) {
var pluginKey = new PluginKey(serviceClass, protocol);
if (!PluginServiceInfo.SERVICE_NAMES.containsKey(serviceClass.getName()))
throw new EUnexpected();
if (!plugins.containsKey(pluginKey)) {
var rawTypeName = PluginServiceInfo.SERVICE_NAMES.get(serviceClass.getName());
var message = String.format("Plugin not available for %s protocol: [%s]", prettyTypeName(rawTypeName, false), protocol);
log.error(message);
throw new EPluginNotAvailable(message);
}
var plugin = plugins.get(pluginKey);
return plugin.createService(serviceClass, protocol, properties);
}
use of com.accenture.trac.common.exception.EPluginNotAvailable in project tracdap by finos.
the class TracDataService method checkDefaultStorageAndFormat.
private void checkDefaultStorageAndFormat(IStorageManager storage, ICodecManager formats, DataServiceConfig config) {
try {
storage.getFileStorage(config.getDefaultStorageKey());
storage.getDataStorage(config.getDefaultStorageKey());
formats.getCodec(config.getDefaultStorageFormat());
} catch (EStorageConfig e) {
var msg = String.format("Storage not configured for default storage key: [%s]", config.getDefaultStorageKey());
log.error(msg);
throw new EStartup(msg, e);
} catch (EPluginNotAvailable e) {
var msg = String.format("Codec not available for default storage format: [%s]", config.getDefaultStorageFormat());
log.error(msg);
throw new EStartup(msg, e);
}
}
Aggregations