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.kernel.backgroundtask;
016    
017    import com.liferay.portal.kernel.exception.SystemException;
018    import com.liferay.portal.model.BackgroundTask;
019    
020    /**
021     * @author Michael C. Han
022     */
023    public class DelegatingBackgroundTaskExecutor
024            implements BackgroundTaskExecutor {
025    
026            public DelegatingBackgroundTaskExecutor(
027                    BackgroundTaskExecutor backgroundTaskExecutor) {
028    
029                    _backgroundTaskExecutor = backgroundTaskExecutor;
030            }
031    
032            @Override
033            public BackgroundTaskResult execute(BackgroundTask backgroundTask)
034                    throws Exception {
035    
036                    return _backgroundTaskExecutor.execute(backgroundTask);
037            }
038    
039            @Override
040            public BackgroundTaskStatusMessageTranslator
041                    getBackgroundTaskStatusMessageTranslator() {
042    
043                    return _backgroundTaskExecutor.
044                            getBackgroundTaskStatusMessageTranslator();
045            }
046    
047            @Override
048            public String handleException(BackgroundTask backgroundTask, Exception e)
049                    throws SystemException {
050    
051                    return _backgroundTaskExecutor.handleException(backgroundTask, e);
052            }
053    
054            @Override
055            public boolean isSerial() {
056                    return _backgroundTaskExecutor.isSerial();
057            }
058    
059            protected BackgroundTaskExecutor getBackgroundTaskExecutor() {
060                    return _backgroundTaskExecutor;
061            }
062    
063            private BackgroundTaskExecutor _backgroundTaskExecutor;
064    
065    }