Package org.pentaho.platform.api.engine

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


    } else if ( -1 == pentahoObjectFactoryConfigFile.indexOf( "/" ) ) { //$NON-NLS-1$
      pentahoObjectFactoryConfigFile =
        solutionPath + SYSTEM_FOLDER + "/" + pentahoObjectFactoryConfigFile; //$NON-NLS-1$
    }
    // else objectFactoryCreatorCfgFile contains the full path.
    IPentahoObjectFactory pentahoObjectFactory;
    try {
      Class<?> classObject = Class.forName( pentahoObjectFactoryClassName );
      pentahoObjectFactory = (IPentahoObjectFactory) classObject.newInstance();
    } catch ( Exception e ) {
      String msg =
        Messages.getInstance().getErrorString(
          "SolutionContextListener.ERROR_0002_BAD_OBJECT_FACTORY", pentahoObjectFactoryClassName ); //$NON-NLS-1$
      // Cannot proceed without an object factory, so we'll put some context around what
      // we were trying to do throw a runtime exception
      throw new RuntimeException( msg, e );
    }
    pentahoObjectFactory.init( pentahoObjectFactoryConfigFile, context );
    PentahoSystem.registerPrimaryObjectFactory( pentahoObjectFactory );
  }
View Full Code Here


        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$
      }
      ApplicationContext springApplicationContext = getSpringApplicationContext();

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

      // force Spring to inject PentahoSystem, there has got to be a better way than this, perhaps an alternate way
      // of
      // initting spring's app context
View Full Code Here

        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$
      }
      ApplicationContext springApplicationContext = getSpringApplicationContext();

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

      // force Spring to populate PentahoSystem
      springApplicationContext.getBean( "pentahoSystemProxy" ); //$NON-NLS-1$
      initOk = PentahoSystem.init( applicationContext );
View Full Code Here

      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 );
    PentahoSystem.init( applicationContext );
    session = new StandaloneSession( "system" ); //$NON-NLS-1$
  }
View Full Code Here

   * Sets the StandaloneSpringPentahoObjectFactory for the Pentaho platform by xml path
   *
   * @return
   */
  public void setSpringConfig( String cfgFile ) {
    IPentahoObjectFactory pentahoObjectFactory = new StandaloneSpringPentahoObjectFactory();
    pentahoObjectFactory.init( cfgFile, null );
    setFactory( pentahoObjectFactory );
  }
View Full Code Here

   *         specified, it will default to getting the information from {@link PentahoSystem.get()}
   */
  public ITenantManager getTenantManager() {
    // Check ... if we haven't been injected with a lifecycle manager, get one from PentahoSystem
    try {
      IPentahoObjectFactory objectFactory = PentahoSystem.getObjectFactory();
      IPentahoSession pentahoSession = PentahoSessionHolder.getSession();
      return ( null != tenantManager ? tenantManager : objectFactory.get( ITenantManager.class, "tenantMgrProxy",
          pentahoSession ) );
    } catch ( ObjectFactoryException e ) {
      return null;
    }
  }
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.