Package org.pentaho.platform.api.engine

Examples of org.pentaho.platform.api.engine.IPentahoObjectFactory


    systemResource = new SystemResource( systemConfig );

    StandaloneApplicationContext applicationContext = new StandaloneApplicationContext( getSolutionPath(), "" ); //$NON-NLS-1$

    ApplicationContext springApplicationContext = getSpringApplicationContext();
    IPentahoObjectFactory pentahoObjectFactory = new StandaloneSpringPentahoObjectFactory();
    pentahoObjectFactory.init( null, springApplicationContext );
    PentahoSystem.registerObjectFactory( pentahoObjectFactory );

    // force Spring to populate PentahoSystem
    boolean initOk = PentahoSystem.init( applicationContext );
View Full Code Here


  @Test
  public void testBoot() throws Exception {
    PentahoSystemBoot boot = new PentahoSystemBoot();
    boot.setFilePath( "test-src/solution" );

    IPentahoObjectFactory factory = boot.getFactory();
    assertNotNull( "object factory is null", factory );

    assertTrue( "object factory not definable", factory instanceof IPentahoDefinableObjectFactory );

    boot.define( ISolutionEngine.class.getSimpleName(), Object1.class.getName(),
      IPentahoDefinableObjectFactory.Scope.GLOBAL );
    boot.define( "MyObject", Object1.class.getName(), IPentahoDefinableObjectFactory.Scope.GLOBAL );
    boot.define( "MyObject", Object2.class.getName(), IPentahoDefinableObjectFactory.Scope.GLOBAL );

    assertFalse( boot.isInitialized() );

    boolean ok = boot.start();

    assertNull( boot.getSettingsProvider() );

    assertTrue( boot.isInitialized() );
    assertTrue( ok );

    factory = boot.getFactory();
    Object2 object = factory.get( Object2.class, "MyObject", null );

    assertNotNull( "object get failed", object );

    assertEquals( "file path is wrong", "test-src/solution", boot.getFilePath() );
View Full Code Here

    List<IPentahoSystemListener> lifecycleListeners3 = boot.getLifecycleListeners();
    assertEquals( 1, lifecycleListeners3.size() );
    assertEquals( lifecycleListener2, lifecycleListeners3.get( 0 ) );
    assertEquals( lifecycleListeners2, lifecycleListeners3 );

    IPentahoObjectFactory factory = boot.getFactory();
    assertNotNull( "object factory is null", factory );

    assertTrue( "object factory not definable", factory instanceof IPentahoDefinableObjectFactory );

    assertFalse( boot.isInitialized() );
View Full Code Here

    List<ISessionStartupAction> startupActions3 = boot.getStartupActions();
    assertEquals( 1, startupActions3.size() );
    assertEquals( startupAction2, startupActions3.get( 0 ) );
    assertEquals( startupActions2, startupActions3 );

    IPentahoObjectFactory factory = boot.getFactory();
    assertNotNull( "object factory is null", factory );

    assertTrue( "object factory not definable", factory instanceof IPentahoDefinableObjectFactory );

    assertFalse( boot.isInitialized() );
View Full Code Here

  @Test
  public void testBootSettings() throws Exception {
    PentahoSystemBoot boot = new PentahoSystemBoot();
    boot.setFilePath( "test-src/solution" );

    IPentahoObjectFactory factory = boot.getFactory();
    assertNotNull( "object factory is null", factory );

    SystemSettings settings = new SystemSettings();
    boot.setSettingsProvider( settings );
View Full Code Here

   * Sets up the defaults: - File-based repository - SQL datasource connections - MXL datasources - File outputs
   */
  @Override
  protected void configure( String solutionPath, String baseUrl, IPentahoDefinableObjectFactory factory ) {
    super.configure( null, null, null );
    IPentahoObjectFactory objectFactory = getFactory();
    if ( objectFactory instanceof IPentahoDefinableObjectFactory ) {
      define( ISolutionEngine.class, SolutionEngine.class, Scope.LOCAL );
      define( IUnifiedRepository.class, FileSystemBackedUnifiedRepository.class, Scope.SESSION );
      define( "connection-XML", XQConnection.class, Scope.LOCAL ); //$NON-NLS-1$
      define( "connection-SQL", SQLConnection.class, Scope.LOCAL ); //$NON-NLS-1$
View Full Code Here

  /**
   * Enables the components necessary to create reports
   */
  public void enableOlap() {
    IPentahoObjectFactory objectFactory = getFactory();
    if ( objectFactory instanceof IPentahoDefinableObjectFactory ) {
      define( "connection-MDX", MDXConnection.class.getName(), Scope.LOCAL ); //$NON-NLS-1$
    }
    addLifecycleListener( new MondrianSystemListener() );
  }
View Full Code Here

  /**
   * Enables the pooled datasources
   */
  public void enablePooledDatasources() {
    IPentahoObjectFactory objectFactory = getFactory();
    if ( objectFactory instanceof IPentahoDefinableObjectFactory ) {
      define( IDBDatasourceService.class, PooledOrJndiDatasourceService.class, Scope.LOCAL );
    }
    addLifecycleListener( new PooledDatasourceSystemListener() );
  }
View Full Code Here

  /**
   * Enables the metadata services
   */
  public void enableMetadata() {
    IPentahoObjectFactory objectFactory = getFactory();
    if ( objectFactory instanceof IPentahoDefinableObjectFactory ) {
      define( IMetadataDomainRepository.class,
          org.pentaho.platform.plugin.services.metadata.CachingPentahoMetadataDomainRepository.class, Scope.GLOBAL );
    }
  }
View Full Code Here

      System.setProperty( "java.naming.factory.initial", "org.osjava.sj.SimpleContextFactory" ); //$NON-NLS-1$ //$NON-NLS-2$
      System.setProperty( "org.osjava.sj.root", getSolutionPath() + "/system/simple-jndi" ); //$NON-NLS-1$ //$NON-NLS-2$
      System.setProperty( "org.osjava.sj.delimiter", "/" ); //$NON-NLS-1$ //$NON-NLS-2$
    }
    String objectFactoryCreatorCfgFile = getSolutionPath() + SYSTEM_FOLDER + "/" + DEFAULT_SPRING_CONFIG_FILE_NAME; //$NON-NLS-1$
    IPentahoObjectFactory pentahoObjectFactory = new StandaloneSpringPentahoObjectFactory();
    pentahoObjectFactory.init( objectFactoryCreatorCfgFile, null );
    PentahoSystem.registerObjectFactory( pentahoObjectFactory );
    return PentahoSystem.init( applicationContext );
  }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.api.engine.IPentahoObjectFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.