1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.workflow.service.base;
24  
25  import com.liferay.portal.service.impl.PrincipalBean;
26  
27  import com.liferay.portlet.workflow.service.WorkflowComponentService;
28  import com.liferay.portlet.workflow.service.WorkflowComponentServiceFactory;
29  import com.liferay.portlet.workflow.service.WorkflowDefinitionService;
30  import com.liferay.portlet.workflow.service.WorkflowDefinitionServiceFactory;
31  import com.liferay.portlet.workflow.service.WorkflowInstanceService;
32  import com.liferay.portlet.workflow.service.WorkflowTaskService;
33  import com.liferay.portlet.workflow.service.WorkflowTaskServiceFactory;
34  
35  import org.springframework.beans.factory.InitializingBean;
36  
37  /**
38   * <a href="WorkflowInstanceServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
39   *
40   * @author Brian Wing Shun Chan
41   *
42   */
43  public abstract class WorkflowInstanceServiceBaseImpl extends PrincipalBean
44      implements WorkflowInstanceService, InitializingBean {
45      public WorkflowComponentService getWorkflowComponentService() {
46          return workflowComponentService;
47      }
48  
49      public void setWorkflowComponentService(
50          WorkflowComponentService workflowComponentService) {
51          this.workflowComponentService = workflowComponentService;
52      }
53  
54      public WorkflowDefinitionService getWorkflowDefinitionService() {
55          return workflowDefinitionService;
56      }
57  
58      public void setWorkflowDefinitionService(
59          WorkflowDefinitionService workflowDefinitionService) {
60          this.workflowDefinitionService = workflowDefinitionService;
61      }
62  
63      public WorkflowTaskService getWorkflowTaskService() {
64          return workflowTaskService;
65      }
66  
67      public void setWorkflowTaskService(WorkflowTaskService workflowTaskService) {
68          this.workflowTaskService = workflowTaskService;
69      }
70  
71      public void afterPropertiesSet() {
72          if (workflowComponentService == null) {
73              workflowComponentService = WorkflowComponentServiceFactory.getImpl();
74          }
75  
76          if (workflowDefinitionService == null) {
77              workflowDefinitionService = WorkflowDefinitionServiceFactory.getImpl();
78          }
79  
80          if (workflowTaskService == null) {
81              workflowTaskService = WorkflowTaskServiceFactory.getImpl();
82          }
83      }
84  
85      protected WorkflowComponentService workflowComponentService;
86      protected WorkflowDefinitionService workflowDefinitionService;
87      protected WorkflowTaskService workflowTaskService;
88  }