Search in sources :

Example 1 with PluginLifecycleException

use of org.pentaho.platform.api.engine.PluginLifecycleException in project pdi-platform-plugin by pentaho.

the class PdiLifecycleListener method init.

public void init() throws PluginLifecycleException {
    try {
        KettleSystemListener.environmentInit(null);
        KettleLogStore.getAppender().addLoggingEventListener(new Slf4jLoggingEventListener());
    } catch (KettleException e) {
        throw new PluginLifecycleException(e);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) Slf4jLoggingEventListener(org.pentaho.di.core.logging.Slf4jLoggingEventListener) PluginLifecycleException(org.pentaho.platform.api.engine.PluginLifecycleException)

Example 2 with PluginLifecycleException

use of org.pentaho.platform.api.engine.PluginLifecycleException 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());
    }
}
Also used : IPluginResourceLoader(org.pentaho.platform.api.engine.IPluginResourceLoader) PluginLifecycleException(org.pentaho.platform.api.engine.PluginLifecycleException) DelegatingBackingRepositoryLifecycleManager(org.pentaho.platform.repository2.unified.lifecycle.DelegatingBackingRepositoryLifecycleManager)

Aggregations

PluginLifecycleException (org.pentaho.platform.api.engine.PluginLifecycleException)2 KettleException (org.pentaho.di.core.exception.KettleException)1 Slf4jLoggingEventListener (org.pentaho.di.core.logging.Slf4jLoggingEventListener)1 IPluginResourceLoader (org.pentaho.platform.api.engine.IPluginResourceLoader)1 DelegatingBackingRepositoryLifecycleManager (org.pentaho.platform.repository2.unified.lifecycle.DelegatingBackingRepositoryLifecycleManager)1