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.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    }