/*
 * Created on 2004-6-23
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package workflow.store.factory;

import java.util.Hashtable;

import workflow.WorkflowException;
import workflow.store.CaseDatabase;
import workflow.store.UserDatabase;
import workflow.store.WorkflowDispatcher;

/**
 * @author reic
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public abstract class StoreFactory
{
	protected StoreFactory()
	{
	}

	public static StoreFactory newInstance(Hashtable env) throws FactoryConfigurationError
	{
		try
		{
			return (StoreFactory) FactoryFinder.find(
				(String) env.get(Constants.WORKFLOW_STORE_XPDL),
				"com.zosatapo.workflow.store.factory.StoreFactoryImpl");
		}
		catch (FactoryFinder.ConfigurationError e)
		{
			throw new FactoryConfigurationError(e.getException(), e.getMessage());
		}
	}

	public abstract UserDatabase newUserDatabase(Hashtable env)
		throws WorkflowException;

	public abstract CaseDatabase newCaseDatabase(Hashtable env)
		throws WorkflowException;

	public abstract WorkflowDispatcher newWorkDispatcher(Hashtable env)
		throws WorkflowException;
}
