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.service;
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     * @author Connor McKay
024     */
025    public class PersistedModelLocalServiceRegistryUtil {
026    
027            public static PersistedModelLocalService getPersistedModelLocalService(
028                    String className) {
029    
030                    return getPersistedModelLocalServiceRegistry().
031                            getPersistedModelLocalService(className);
032            }
033    
034            public static PersistedModelLocalServiceRegistry
035                    getPersistedModelLocalServiceRegistry() {
036    
037                    return _persistedModelLocalServiceRegistry;
038            }
039    
040            public static List<PersistedModelLocalService>
041                    getPersistedModelLocalServices() {
042    
043                    return getPersistedModelLocalServiceRegistry().
044                            getPersistedModelLocalServices();
045            }
046    
047            public static boolean isPermissionedModelLocalService(String className) {
048                    return getPersistedModelLocalServiceRegistry().
049                            isPermissionedModelLocalService(className);
050            }
051    
052            public static void register(
053                    String className,
054                    PersistedModelLocalService persistedModelLocalService) {
055    
056                    getPersistedModelLocalServiceRegistry().register(
057                            className, persistedModelLocalService);
058            }
059    
060            public static void unregister(String className) {
061                    getPersistedModelLocalServiceRegistry().unregister(className);
062            }
063    
064            public void setPersistedModelLocalServiceRegistry(
065                    PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry) {
066    
067                    PortalRuntimePermission.checkSetBeanProperty(getClass());
068    
069                    _persistedModelLocalServiceRegistry =
070                            persistedModelLocalServiceRegistry;
071            }
072    
073            private static PersistedModelLocalServiceRegistry
074                    _persistedModelLocalServiceRegistry;
075    
076    }