Examples of defineObject()


Examples of org.pentaho.platform.api.engine.IPentahoDefinableObjectFactory.defineObject()

   *           if the object factory does not support runtime object definition
   */
  public PentahoSystemBoot define( String key, String implClassName, Scope scope ) {
    if ( factory instanceof IPentahoDefinableObjectFactory ) {
      IPentahoDefinableObjectFactory definableFactory = (IPentahoDefinableObjectFactory) getFactory();
      definableFactory.defineObject( key, implClassName, scope );
    } else {
      throw new NoSuchMethodError( "define is only supported by IPentahoDefinableObjectFactory" ); //$NON-NLS-1$
    }
    return this;
  }
View Full Code Here

Examples of org.pentaho.platform.engine.core.system.objfac.StandaloneObjectFactory.defineObject()

    StandaloneSpringPentahoObjectFactory factory2 = new StandaloneSpringPentahoObjectFactory();
    factory2.init( "test-res/solution/system/pentahoObjects.spring.xml", null );

    StandaloneObjectFactory factory3 = new StandaloneObjectFactory();
    factory3.init( null, null );
    factory3.defineObject( "MimeTypeListener", MimeTypeListener.class.getName(),
      IPentahoDefinableObjectFactory.Scope.GLOBAL );

    AggregateObjectFactory aggFactory = new AggregateObjectFactory();
    aggFactory.registerObjectFactory( factory3 );
    aggFactory.registerObjectFactory( factory2 );
View Full Code Here

Examples of org.pentaho.platform.engine.core.system.objfac.StandaloneObjectFactory.defineObject()

  public void testBadScope() throws Exception {

    IPentahoSession session1 = new StandaloneSession( "test user 1" ); //$NON-NLS-1$
    StandaloneObjectFactory factory = new StandaloneObjectFactory();

    factory.defineObject( Object1.class.getSimpleName(), Object1.class.getName(), null );

    Object obj = factory.get( Object1.class, session1 );
    assertNull( "object should be null", obj ); //$NON-NLS-1$

  }
View Full Code Here

Examples of org.pentaho.platform.engine.core.system.objfac.StandaloneObjectFactory.defineObject()

  public void testImplementingClass() throws Exception {

    IPentahoSession session1 = new StandaloneSession( "test user 1" ); //$NON-NLS-1$
    StandaloneObjectFactory factory = new StandaloneObjectFactory();

    factory.defineObject( Object1.class.getSimpleName(), Object1.class.getName(), Scope.GLOBAL );
    factory.defineObject( "bogus2", "bogus", Scope.GLOBAL ); //$NON-NLS-1$ //$NON-NLS-2$

    Object1 obj = factory.get( Object1.class, session1 );
    assertNotNull( obj );
View Full Code Here

Examples of org.pentaho.platform.engine.core.system.objfac.StandaloneObjectFactory.defineObject()

    IPentahoSession session1 = new StandaloneSession( "test user 1" ); //$NON-NLS-1$
    StandaloneObjectFactory factory = new StandaloneObjectFactory();

    factory.defineObject( Object1.class.getSimpleName(), Object1.class.getName(), Scope.GLOBAL );
    factory.defineObject( "bogus2", "bogus", Scope.GLOBAL ); //$NON-NLS-1$ //$NON-NLS-2$

    Object1 obj = factory.get( Object1.class, session1 );
    assertNotNull( obj );

    assertEquals( Object1.class.getName(), factory.getImplementingClass( Object1.class.getSimpleName() ).getName() );
View Full Code Here

Examples of org.pentaho.platform.engine.core.system.objfac.StandaloneObjectFactory.defineObject()

  public void testImplementingClassNotFound() throws Exception {

    StandaloneObjectFactory factory = new StandaloneObjectFactory();

    factory.defineObject( "bogus", "NotARealClass", Scope.GLOBAL ); //$NON-NLS-1$ //$NON-NLS-2$

    try {
      factory.getImplementingClass( "bogus" );
      fail( "exception was expected" );
    } catch ( RuntimeException e ) {
View Full Code Here

Examples of org.pentaho.platform.engine.core.system.objfac.StandaloneObjectFactory.defineObject()

  public void testInit() throws Exception {

    IPentahoSession session1 = new StandaloneSession( "test user 1" ); //$NON-NLS-1$
    StandaloneObjectFactory factory = new StandaloneObjectFactory();

    factory.defineObject( Object1.class.getSimpleName(), Object1.class.getName(), Scope.GLOBAL );

    assertTrue( "Object is not defined", factory.objectDefined( Object1.class.getSimpleName() ) ); //$NON-NLS-1$
    Object1 obj1 = factory.get( Object1.class, session1 );
    assertNotNull( "Object is null", obj1 ); //$NON-NLS-1$
View Full Code Here

Examples of org.pentaho.platform.engine.core.system.objfac.StandaloneObjectFactory.defineObject()

  public void testGlobalObject1() throws Exception {

    StandaloneObjectFactory factory = new StandaloneObjectFactory();

    factory.defineObject( Object1.class.getSimpleName(), Object1.class.getName(), Scope.GLOBAL );

    factory.defineObject( BadObjectRuntime.class.getSimpleName(), BadObjectRuntime.class.getName(), Scope.GLOBAL );
    factory.defineObject( BadObject.class.getSimpleName(), BadObject.class.getName(), Scope.GLOBAL );

    IPentahoSession session1 = new StandaloneSession( "test user 1" ); //$NON-NLS-1$
View Full Code Here

Examples of org.pentaho.platform.engine.core.system.objfac.StandaloneObjectFactory.defineObject()

    StandaloneObjectFactory factory = new StandaloneObjectFactory();

    factory.defineObject( Object1.class.getSimpleName(), Object1.class.getName(), Scope.GLOBAL );

    factory.defineObject( BadObjectRuntime.class.getSimpleName(), BadObjectRuntime.class.getName(), Scope.GLOBAL );
    factory.defineObject( BadObject.class.getSimpleName(), BadObject.class.getName(), Scope.GLOBAL );

    IPentahoSession session1 = new StandaloneSession( "test user 1" ); //$NON-NLS-1$
    IPentahoSession session2 = new StandaloneSession( "test user 2" ); //$NON-NLS-1$
View Full Code Here

Examples of org.pentaho.platform.engine.core.system.objfac.StandaloneObjectFactory.defineObject()

    StandaloneObjectFactory factory = new StandaloneObjectFactory();

    factory.defineObject( Object1.class.getSimpleName(), Object1.class.getName(), Scope.GLOBAL );

    factory.defineObject( BadObjectRuntime.class.getSimpleName(), BadObjectRuntime.class.getName(), Scope.GLOBAL );
    factory.defineObject( BadObject.class.getSimpleName(), BadObject.class.getName(), Scope.GLOBAL );

    IPentahoSession session1 = new StandaloneSession( "test user 1" ); //$NON-NLS-1$
    IPentahoSession session2 = new StandaloneSession( "test user 2" ); //$NON-NLS-1$

    Object1 obj1 = factory.get( Object1.class, session1 );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.