[jboss-user] [jBPM Users] - jBPM 4 and thread-safeness
do-not-reply at jboss.com
Thu Sep 10 18:16:15 EDT 2009
I've been working for 2-3 years with jBPM 2/3 and now have the time to evaluate if I should switch to version 4 in future. In the user-guide I read the following:
anonymous wrote :
| For all objects that are referenced by a class name, will be instantiated during parsing time. Which implies that the objects have to be threadsafe. This is typically OK since those objects are typically immutable
In jBPM 3 an ActionHandler-Implementation was instantiated (lazy) at runtime. There was no need for an Action-impl to be threadsafe (and if several config-arguments were injected via processdefinition it wasn't for sure threadsafe :-). But although it was not threadsafe it was reusable - if an action was executed a second time (not concurrently) it was already instantiated.
But what is the difference in jBPM4 now? In a Java-Task for example it is still possible to provide arguments via declaration so this object (which is referenced by class-name) will never be threadsafe (except I chose the dirty way and make the variables final).
So my questions are:
Why do these objects have to be threadsafe? For me it doesn't make a difference if such a class is instantiated at parsing- or runtime.
If they must be threadsafe why are the classes in the examples not threadsafe
Why are objects instantiated (at parsing time) which maybe never will be used (who can guess the path of execution)?
Thanks in advance
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4254605#4254605
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4254605
More information about the jboss-user