001    /**
002     * Copyright (c) 2000-2011 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.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    }