package com.eactive.eai.flowcontrol.action;

import com.eactive.eai.common.util.Logger;

public class RouteActionFactory {
	
	static Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
	
	public static RouteAction createAction(String actionName) throws RouteActionException {
        RouteAction action = null;
        try {
            Class cl = Class.forName(actionName);
            action = (RouteAction)cl.newInstance();
        } catch(Exception e) {
        	logger.error("Cannot create a RouteAction.", e);
        	throw new RouteActionException("Cannot create a RouteAction. - "+actionName);   
        }
        return action;
    }
}
