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.display;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.backgroundtask.BackgroundTask;
020    import com.liferay.portal.kernel.backgroundtask.BackgroundTaskStatusRegistryUtil;
021    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
022    import com.liferay.portal.kernel.util.ProxyFactory;
023    
024    /**
025     * @author Andrew Betts
026     */
027    @ProviderType
028    public class BackgroundTaskDisplayFactoryUtil {
029    
030            public static BackgroundTaskDisplay getBackgroundTaskDisplay(
031                    BackgroundTask backgroundTask) {
032    
033                    return getBackgroundTaskDisplayFactory().getBackgroundTaskDisplay(
034                            backgroundTask);
035            }
036    
037            public static BackgroundTaskDisplay getBackgroundTaskDisplay(
038                    long backgroundTaskId) {
039    
040                    return getBackgroundTaskDisplayFactory().getBackgroundTaskDisplay(
041                            backgroundTaskId);
042            }
043    
044            public static BackgroundTaskDisplayFactory
045                    getBackgroundTaskDisplayFactory() {
046    
047                    PortalRuntimePermission.checkGetBeanProperty(
048                            BackgroundTaskStatusRegistryUtil.class);
049    
050                    return _backgroundTaskDisplayFactory;
051            }
052    
053            private static final BackgroundTaskDisplayFactory
054                    _backgroundTaskDisplayFactory = ProxyFactory.newServiceTrackedInstance(
055                            BackgroundTaskDisplayFactory.class);
056    
057    }