ITeye博客

ODE的实现技术研究(jacob)

cocogg · 2009-03-09 14:25 · SOA相关 · Markdown

ODE引擎运行时利用Java并发对象(Java Concurrent Objects,Jacob)来完成过程实例的状态表示和并发性管理。 Jacob提供了应用级的并发机制,它不依赖于线程,这样就降低了系统的开销。

ODE的官方网站提供了一份Jacob的教程,粗略的读了以下,略知一二。 希望有兴趣的朋友一起探讨,或者明白的朋友,不吝赐教。

继续研究中.....http://ode.apache.org/jacob.html

基本原理 先看一个例子

void process(order) {
  billingService.bill(order.billing);
  shippingService.ship(order.product, order.shipping, self);
  shipping = receive("shipping")
  order.customer.send(shipping.details);
}

java 伪代码看起来没什么问题,但是存在缺陷: 1、程序执行过程中出现问题,用户不得不再次发送订单。 2、等待线程过多的时候会导致java虚机down掉。

做如下修改

void process(order) {
  billingService.bill(order.billing);
  shippingService.ship(order.product, order.shipping, self);
  listenOn("shipping", part2);
}
void part2(shipping) {
  order.customer.send(shipping.details);
}

看起来会好一些, but still has a lot of points of failure, where you're not sure if you actually billed the customer and shipped the product or not.

评论(2)

  1. #2 楼 · cocogg · 2009-05-11 16:32

    是没写完,最近比较忙,一直没有时间来写。有什么问题可以加我msn讨论。zyzgg@hotmail.com

  2. #1 楼 · kungstriving · 2009-05-11 11:00

    你好,我也在做相关方面的研究,这篇文章好像没写完啊,你是在做翻译吗

评论功能维护中,当前仅展示历史评论。