/*******************************************************************************
 * Copyright (c) 2004 Actuate Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Actuate Corporation  - initial API and implementation
 *******************************************************************************/
package org.eclipse.birt.report.model.extension.oda;

import org.eclipse.birt.report.model.core.DesignElement;
import org.eclipse.birt.report.model.plugin.ODABaseProviderFactory;

/**
 * This class is used to wrap the ODA code. The
 * <code>ODABaseProviderFactory</code> is the real object cached in the this
 * class to create the <code>ODAProvider</code>. This class must be
 * initialized firstly to set the <code>baseFactory</code>.
 */
public class ODAProviderFactory implements IODAProviderFactory
{

	/*
	 * Factory used to create the ODAProvider instance.
	 */
	private static ODABaseProviderFactory baseFactory = null;

	/*
	 * The only one ODAProviderFactory instance.
	 */
	private static ODAProviderFactory instance = new ODAProviderFactory( );

	/**
	 * Returns the ODAProviderFactory instance.
	 * 
	 * @return ODAProviderFactory intance.
	 */

	public static ODAProviderFactory getInstance( )
	{
		return instance;
	}

	/**
	 * Returns the ODAProvider based on the element and the extension Id.
	 * 
	 * @param element
	 *            the ODA element.
	 * @param extensionID
	 *            The extension Id used to create the corresponding ODA element
	 *            definition.
	 * @return the ODA provider instance.
	 */
	public  ODAProvider createODAProvider( DesignElement element,
			String extensionID )
	{
		if ( baseFactory != null )
			return baseFactory.createODAProvider( element, extensionID );

		return null;
	}

	/**
	 * Set the base factory for this clss. This methdo should be called before
	 * any other operation.
	 * 
	 * @param base
	 *            The real factory class used to create the ODA provider.
	 */

	public synchronized static void initeTheFactory( ODABaseProviderFactory base )
	{
		if ( baseFactory != null )
			return;

		baseFactory = base;
	}
}

@@ -523,16 +523,17 @@
 ******/%0A
+%0A
 package 
@@ -638,76 +638,8 @@
 ent;
-%0Aimport org.eclipse.birt.report.model.plugin.ODABaseProviderFactory;
 %0A%0A/*
@@ -1041,23 +1041,20 @@
  static 
+I
 ODA
-Base
 Provider
@@ -1698,17 +1698,16 @@
 %09public 
- 
 ODAProvi
@@ -2147,23 +2147,20 @@
 actory( 
+I
 ODA
-Base
 Provider

Fix 134057 -- ODA provider issues when start tomcat standalone.