use of org.pentaho.platform.repository2.unified.lifecycle.DelegatingBackingRepositoryLifecycleManager in project data-access by pentaho.
the class DataAccessLifecycleListener method ready.
@Override
public void ready() throws PluginLifecycleException {
// the platform is booted, spring initialized, all plugins init and loaded
boolean enableAgilemartDatasource = false;
try {
IPluginResourceLoader resLoader = PentahoSystem.get(IPluginResourceLoader.class, null);
enableAgilemartDatasource = Boolean.parseBoolean(resLoader.getPluginSetting(DataAccessLifecycleListener.class, ENABLE_AGILEMART_DATASOURCE, "false"));
} catch (Throwable t) {
log.warn(t.getMessage(), t);
}
if (enableAgilemartDatasource) {
try {
SecurityHelper.getInstance().runAsSystem(new Callable<Void>() {
public Void call() throws Exception {
AgileMartDatasourceLifecycleManager.getInstance().startup();
return null;
}
});
} catch (Exception e) {
log.warn(e.getMessage(), e);
}
DelegatingBackingRepositoryLifecycleManager manager = PentahoSystem.get(DelegatingBackingRepositoryLifecycleManager.class, "backingRepositoryLifecycleManager", null);
manager.addLifeCycleManager(AgileMartDatasourceLifecycleManager.getInstance());
}
}
Aggregations