001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.struts;
016    
017    import com.liferay.portal.kernel.struts.StrutsAction;
018    import com.liferay.portal.kernel.struts.StrutsPortletAction;
019    
020    import java.util.Map;
021    
022    import org.apache.struts.action.Action;
023    
024    /**
025     * @author Mika Koivisto
026     * @author Raymond Aug??
027     */
028    public class StrutsActionRegistryUtil {
029    
030            public static Action getAction(String path) {
031                    return getStrutsActionRegistry().getAction(path);
032            }
033    
034            public static Map<String, Action> getActions() {
035                    return getStrutsActionRegistry().getActions();
036            }
037    
038            public static StrutsActionRegistry getStrutsActionRegistry() {
039                    return _strutsActionRegistry;
040            }
041    
042            public static void register(String path, StrutsAction strutsAction) {
043                    getStrutsActionRegistry().register(path, strutsAction);
044            }
045    
046            public static void register(
047                    String path, StrutsPortletAction strutsPortletAction) {
048    
049                    getStrutsActionRegistry().register(path, strutsPortletAction);
050            }
051    
052            public static void unregister(String path) {
053                    getStrutsActionRegistry().unregister(path);
054            }
055    
056            public void setStrutsActionRegistry(
057                    StrutsActionRegistry strutsActionRegistry) {
058    
059                    _strutsActionRegistry = strutsActionRegistry;
060            }
061    
062            private static StrutsActionRegistry _strutsActionRegistry;
063    
064    }