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.kernel.webdav.methods;
016    
017    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018    
019    import java.util.List;
020    
021    /**
022     * @author Brian Wing Shun Chan
023     */
024    public class MethodFactoryRegistryUtil {
025    
026            public static MethodFactory getDefaultMethodFactory() {
027                    return getMethodFactoryRegistry().getDefaultMethodFactory();
028            }
029    
030            public static MethodFactory getMethodFactory(String className) {
031                    return getMethodFactoryRegistry().getMethodFactory(className);
032            }
033    
034            public static List<MethodFactory> getMethodFactoryFactories() {
035                    return getMethodFactoryRegistry().getMethodFactories();
036            }
037    
038            public static MethodFactoryRegistry getMethodFactoryRegistry() {
039                    PortalRuntimePermission.checkGetBeanProperty(
040                            MethodFactoryRegistryUtil.class);
041    
042                    return _methodFactoryRegistry;
043            }
044    
045            public static void registerMethodFactory(MethodFactory methodFactory) {
046                    getMethodFactoryRegistry().registerMethodFactory(methodFactory);
047            }
048    
049            public static void unregisterMethodFactory(MethodFactory methodFactory) {
050                    getMethodFactoryRegistry().unregisterMethodFactory(methodFactory);
051            }
052    
053            public void setMethodFactoryRegistry(
054                    MethodFactoryRegistry methodFactoryRegistry) {
055    
056                    PortalRuntimePermission.checkSetBeanProperty(getClass());
057    
058                    _methodFactoryRegistry = methodFactoryRegistry;
059            }
060    
061            private static MethodFactoryRegistry _methodFactoryRegistry;
062    
063    }