Package org.pentaho.platform.api.engine

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


      }
      return object;
    }

    public Object remove( String name ) {
      IPentahoSession session = SpringScopeSessionHolder.SESSION.get();
      return session.removeAttribute( name );
    }
View Full Code Here


   */
  private static class SessionSwapper {
    private static final ThreadLocal<IPentahoSession> originalSessions = new ThreadLocal<IPentahoSession>();

    public static void swap( IPentahoSession tempSession ) {
      IPentahoSession originalSession = PentahoSessionHolder.getSession();

      // Capture even if the same to simplify restore
      originalSessions.set( originalSession );
      if ( originalSession != tempSession ) {
        PentahoSessionHolder.setSession( tempSession );
View Full Code Here

        PentahoSessionHolder.setSession( tempSession );
      }
    }

    public static void restore() {
      IPentahoSession orig = originalSessions.get();
      PentahoSessionHolder.setSession( orig );
    }
View Full Code Here

    super( type, attributes, priority );
    this.creator = creator;
  }

  @Override protected T createObject() throws ObjectFactoryException {
    final IPentahoSession session = PentahoSessionHolder.getSession();
    try {
      return creator.create( session );
    } catch ( Exception e ) {
      throw new ObjectFactoryException( "Error creating instance", e );
    }
View Full Code Here

    this.creator = creator;
  }

  @SuppressWarnings( "unchecked" )
  @Override protected T createObject() throws ObjectFactoryException {
    final IPentahoSession session = PentahoSessionHolder.getSession();

    Map<Class<?>, Object> classObjectMap = cache.get( session );
    if ( classObjectMap == null ) {
      classObjectMap = new WeakHashMap<Class<?>, Object>();
      cache.put( session, classObjectMap );
View Full Code Here

    boot.setFilePath( "test-src/solution" );

    boot.enableReporting();

    // create a user session
    IPentahoSession session = new StandaloneSession( "test" );
    PentahoSessionHolder.setSession( session );

    FileSystemBackedUnifiedRepository repo =
        (FileSystemBackedUnifiedRepository) PentahoSystem.get( IUnifiedRepository.class );
    repo.setRootDir( new File( "test-src/solution" ) );
View Full Code Here

    Domain d = domains.get( id );
    if ( d == null ) {
      return null;
    }
    d = (Domain) d.clone();
    final IPentahoSession session = PentahoSessionHolder.getSession();
    if ( session == null ) {
      return d;
    }
    d.setDescription( new LocalizedString( TEST_LOCALE, PentahoSessionHolder.getSession().getId() ) );
    return d;
View Full Code Here

  }

  public void testBadConfig1() {
    startTest();

    IPentahoSession session = new StandaloneSession( "test user" ); //$NON-NLS-1$
    IPluginManager pluginManager = PentahoSystem.get( IPluginManager.class, session );
    assertNull( pluginManager );

    finishTest();
  }
View Full Code Here

  }

  public void testPluginAdapterViaPublish() throws Exception {
    startTest();

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

    String str = PentahoSystem.publish( session, "org.pentaho.platform.plugin.services.pluginmgr.PluginAdapter" ); //$NON-NLS-1$
    assertEquals( str, Messages.getInstance().getString( "PluginAdapter.ERROR_0001_PLUGIN_MANAGER_NOT_CONFIGURED" ) ); //$NON-NLS-1$
    finishTest();
  }
View Full Code Here

  @SuppressWarnings( "cast" )
  public void testPluginAdapterViaPublisherAPI() throws Exception {
    startTest();

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

    PluginAdapter mgr = new PluginAdapter();
    assertTrue( mgr instanceof IPentahoPublisher );
    IPentahoPublisher publisher = (IPentahoPublisher) mgr;
View Full Code Here

TOP

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

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.