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.util.ProxyFactory;
018    
019    /**
020     * @author Michael C. Han
021     */
022    public class BackgroundTaskExecutorRegistryUtil {
023    
024            public static BackgroundTaskExecutor getBackgroundTaskExecutor(
025                    String backgroundTaskExecutorClassName) {
026    
027                    return _backgroundTaskExecutorRegistry.getBackgroundTaskExecutor(
028                            backgroundTaskExecutorClassName);
029            }
030    
031            public static void registerBackgroundTaskExecutor(
032                    String backgroundTaskExecutorClassName,
033                    BackgroundTaskExecutor backgroundTaskExecutor) {
034    
035                    _backgroundTaskExecutorRegistry.registerBackgroundTaskExecutor(
036                            backgroundTaskExecutorClassName, backgroundTaskExecutor);
037            }
038    
039            public static void unregisterBackgroundTaskExecutor(
040                    String backgroundTaskExecutorClassName) {
041    
042                    _backgroundTaskExecutorRegistry.unregisterBackgroundTaskExecutor(
043                            backgroundTaskExecutorClassName);
044            }
045    
046            private static final BackgroundTaskExecutorRegistry
047                    _backgroundTaskExecutorRegistry =
048                            ProxyFactory.newServiceTrackedInstance(
049                                    BackgroundTaskExecutorRegistry.class);
050    
051    }