---
title: "JbpmServiceFactory与JbpmServices"
author: "hongsoft"
date: "2005-03-08T11:37:00Z"
tags: []
slug: "jbpmservicefactory-jbpmservices"
draft: false
lastmod: "2005-03-08T11:37:00Z"
id: 287480
url: "https://hongsoft.iteye.com/blog/287480"
---

Jbpm对外提供了很多的服务,这些服务统称Service,我们看看  
Service的层次结构图:

--Service  
  |----DefinitionService  
       |----DefinitionServiceImpl  
  |-----ExecutionService  
       |----ExecutionServiceImpl  
  |-----SchedulerServer  
       |----SchedulerServerImpl  
  |-----SchedulerService  
       |----SchedulerServiceImpl  
1)DefinitionService为用户提供流程发布/删除服务  
2)ExecutionService为用户提供流程执行服务  
3)SchedulerServer是job调度服务器  
4)SchedulerService实现job调度服务

上面的服务器,都是由JbpmServiceFactory来产生的,如下:  
DefinitionService ds = JbpmServiceFactory.getInstance().openDefinitionService();  
ds.deployProcessArchive(jis);  
ds.close();  
Service接口并没有定义所有的功能实现,只定义了close()方法,所以,我们用工厂模式来产生  
服务器时,应该指定具体的服务器如DefinitionService,而不能统称Service.