Package org.pentaho.reporting.engine.classic.extensions.datasources.mondrian.parser

Source Code of org.pentaho.reporting.engine.classic.extensions.datasources.mondrian.parser.CubeFileProviderReadHandlerFactory

package org.pentaho.reporting.engine.classic.extensions.datasources.mondrian.parser;

import java.util.Iterator;

import org.pentaho.reporting.engine.classic.core.ClassicEngineBoot;
import org.pentaho.reporting.libraries.base.config.Configuration;
import org.pentaho.reporting.libraries.xmlns.parser.AbstractReadHandlerFactory;

/**
* Todo: Document me!
* <p/>
* Date: 25.08.2009
* Time: 10:07:21
*
* @author Thomas Morgner.
*/
public class CubeFileProviderReadHandlerFactory extends AbstractReadHandlerFactory
{
  private static final String PREFIX_SELECTOR =
      "org.pentaho.reporting.engine.classic.extensions.datasources.mondrian.cube-factory-prefix.";

  private static CubeFileProviderReadHandlerFactory readHandlerFactory;

  public CubeFileProviderReadHandlerFactory()
  {
  }

  protected Class getTargetClass()
  {
    return CubeFileProviderReadHandler.class;
  }

  public static synchronized CubeFileProviderReadHandlerFactory getInstance()
  {
    if (readHandlerFactory == null)
    {
      readHandlerFactory = new CubeFileProviderReadHandlerFactory();
      final Configuration config = ClassicEngineBoot.getInstance().getGlobalConfig();
      final Iterator propertyKeys = config.findPropertyKeys(PREFIX_SELECTOR);
      while (propertyKeys.hasNext())
      {
        final String key = (String) propertyKeys.next();
        final String value = config.getConfigProperty(key);
        if (value != null)
        {
          readHandlerFactory.configure(config, value);
        }
      }
    }
    return readHandlerFactory;
  }

}
TOP

Related Classes of org.pentaho.reporting.engine.classic.extensions.datasources.mondrian.parser.CubeFileProviderReadHandlerFactory

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.