001    /**
002     * Copyright (c) 2000-present 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.backgroundtask;
016    
017    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018    import com.liferay.portal.kernel.util.ProxyFactory;
019    
020    /**
021     * @author Michael C. Han
022     */
023    public class BackgroundTaskStatusRegistryUtil {
024    
025            public static BackgroundTaskStatus getBackgroundTaskStatus(
026                    long backgroundTaskId) {
027    
028                    return getBackgroundTaskStatusRegistry().getBackgroundTaskStatus(
029                            backgroundTaskId);
030            }
031    
032            public static BackgroundTaskStatusRegistry
033                    getBackgroundTaskStatusRegistry() {
034    
035                    PortalRuntimePermission.checkGetBeanProperty(
036                            BackgroundTaskStatusRegistryUtil.class);
037    
038                    return _backgroundTaskStatusRegistry;
039            }
040    
041            public static BackgroundTaskStatus registerBackgroundTaskStatus(
042                    long backgroundTaskId) {
043    
044                    return getBackgroundTaskStatusRegistry().registerBackgroundTaskStatus(
045                            backgroundTaskId);
046            }
047    
048            public static BackgroundTaskStatus unregisterBackgroundTaskStatus(
049                    long backgroundTaskId) {
050    
051                    return getBackgroundTaskStatusRegistry().unregisterBackgroundTaskStatus(
052                            backgroundTaskId);
053            }
054    
055            private static final BackgroundTaskStatusRegistry
056                    _backgroundTaskStatusRegistry = ProxyFactory.newServiceTrackedInstance(
057                            BackgroundTaskStatusRegistry.class);
058    
059    }