001    /**
002     * Copyright (c) 2000-2010 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.workflow;
016    
017    import com.liferay.portal.kernel.messaging.DestinationNames;
018    import com.liferay.portal.kernel.messaging.MessageBusUtil;
019    
020    import java.util.Map;
021    
022    /**
023     * @author Brian Wing Shun Chan
024     */
025    public class WorkflowEngineManagerUtil {
026    
027            public static String getKey() {
028                    return _workflowEngineManager.getKey();
029            }
030    
031            public static String getName() {
032                    return _workflowEngineManager.getName();
033            }
034    
035            public static Map<String, Object> getOptionalAttributes() {
036                    return _workflowEngineManager.getOptionalAttributes();
037            }
038    
039            public static String getVersion() {
040                    return _workflowEngineManager.getVersion();
041            }
042    
043            public static WorkflowEngineManager getWorkflowEngineManager() {
044                    return _workflowEngineManager;
045            }
046    
047            public static boolean isDeployed() {
048                    if (MessageBusUtil.hasMessageListener(
049                                    DestinationNames.WORKFLOW_ENGINE)) {
050    
051                            return true;
052                    }
053                    else {
054                            return false;
055                    }
056            }
057    
058            public void setWorkflowEngineManager(
059                    WorkflowEngineManager workflowEngineManager) {
060    
061                    _workflowEngineManager = workflowEngineManager;
062            }
063    
064            private static WorkflowEngineManager _workflowEngineManager;
065    
066    }