package com.eactive.eai.inbound.action;

public class ActionFactory
{ 
    /*
    private static HashMap actions = new HashMap();
    
    private ActionFactory() {
    }
    
    public static RequestAction createAction(String actionName) throws ActionException {
        RequestAction action = (RequestAction)actions.get(actionName);
        if(action == null) {
            try {
                Class cl = Class.forName(actionName);
                action = (RequestAction)cl.newInstance();
                actions.put(actionName,action);
            } catch(Exception e) {
                throw new ActionException("Cannot create a RequestAction. - "+actionName);   
            }
        }
        
        return action;
    }
    */
    //--------------------------------------------------------------------
    // 200703.29 : DHLEE
    // DefaultRequestAction 읠 중복사용으로 인한 DATA 공유문제
    //--------------------------------------------------------------------
    private ActionFactory() {
    }
    
    public static RequestAction createAction(String actionName) throws ActionException {
        RequestAction action = null;
        try {
            Class cl = Class.forName(actionName);
            action = (RequestAction)cl.newInstance();
        } catch(Exception e) {
            throw new ActionException("Cannot create a RequestAction. - "+actionName);   
        }
        return action;
    }
} 
