开发者

How to write a multithreads model with emf?

I am writting a multithreads program with java, so in my emf model that some class need implements the Runnable class, so i wondered how to do this with emf? such as:

public interface MyClass extends Runnable {

rather than:

public interface MyClass exte开发者_如何转开发nds EObject {

?


As a side note EMF Core itself is not thread safe, two options are existing : EMF-CDO which allow concurrent modifications with transactions EMF-Transaction which allow you to control the way changes are being made spliting those into TransactionalCommands, the changes are not really applied concurrently though.


I don't have an up-to-date EMF install to hand, but the EMF book (ed 2) says that you do this by changing the "Model Class Defaults>Root extends Interface" property in your GenModel.

However, I have my doubts that using Runnable will work. Maybe you should define your own interface that extends both Runnable and EObject ?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜