/*
 * Created on 2004-6-20
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package org.huihoo.willow.client;

import java.util.Hashtable;

import javax.naming.NamingException;

import workflow.WorkflowException;
import workflow.client.WorkflowClient;
import workflow.client.LiveClient;
import workflow.client.factory.LiveClientFactory;

/**
 * @author reic
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public class LiveClientFactoryImpl implements LiveClientFactory
{
	public LiveClient getInitialWfiClient(Hashtable environment) throws WorkflowException, NamingException
	{
		Hashtable env=(Hashtable)environment.clone();
		String providerURL = (String) env.get(WorkflowClient.PROVIDER_URL);
		int comma = providerURL != null ? providerURL.indexOf(',') : -1;
		if(comma>0)
		{
			env.put(WorkflowClient.PROVIDER_URL,providerURL.substring(0,comma));
		}
		return new LiveClientImpl(env);
	}

}
