001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.struts;
016    
017    import com.liferay.portal.kernel.util.ClassResolverUtil;
018    import com.liferay.portal.kernel.util.MethodKey;
019    import com.liferay.portal.kernel.util.PortalClassInvoker;
020    
021    import javax.portlet.ActionRequest;
022    import javax.portlet.ActionResponse;
023    import javax.portlet.PortletConfig;
024    
025    /**
026     * @author Brian Wing Shun Chan
027     */
028    public class PortletActionInvoker {
029    
030            public static void processAction(
031                            String className, PortletConfig portletConfig,
032                            ActionRequest actionRequest, ActionResponse actionResponse)
033                    throws Exception {
034    
035                    MethodKey methodKey = new MethodKey(
036                            ClassResolverUtil.resolveByPortalClassLoader(className),
037                            "processAction",
038                            new Class<?>[] {
039                                    ClassResolverUtil.resolveByPortalClassLoader(
040                                            "org.apache.struts.action.ActionMapping"),
041                                    ClassResolverUtil.resolveByPortalClassLoader(
042                                            "org.apache.struts.action.ActionForm"),
043                                    PortletConfig.class, ActionRequest.class, ActionResponse.class
044                            });
045    
046                    PortalClassInvoker.invoke(
047                            true, methodKey, null, null, portletConfig, actionRequest,
048                            actionResponse);
049            }
050    
051    }