[Design of JBoss jBPM] - Re: programmatic passing of environment objects
by tom.baeyens@jboss.com
"heiko.braun(a)jboss.com" wrote : You can skip the 'finally' when using the callback because it's managed outside of the task service:
|
i don't think so. if the services remain process-engine-context scoped objects, then the callback object would have to be removed just like the provided objects themselves... i think.
internally we only have 1 option:
use a thread local to pass these objects down till the environment is created. in that case the services can remain process-engine-context scoped. if we use thread locals to pass the user provided objects or the callback handlers, that thread local cleanup is also needed for callback handlers.
another alternative would be to create a new service object for each request. but then we would not be able to configure the services. users will not be able to configure customized services. maybe that is an other option to consider. but i don't yet see the full implications of that. feels scary to go that route
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4218535#4218535
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4218535
17 years
[Design the new POJO MicroContainer] - Re: MutableClassInfo?
by stale.pedersen@jboss.org
"alesj" wrote : org.jboss.reflect.spi shouldn't contain Javassist specific classes.
|
| Make it spi.javassist or something similar.
| e.g. we sometimes use helpers pckg
i moved the Body implementations to org.jboss.reflect.plugins.javassist. i was kinda uncertain about where they should be placed since they didnt expose any javassist classes and they are needed to use the mutable classes.
- but the user need to specify javassist specific implementations when he want to create a mutable object, so i guess it fits in the javassist package too.
"alesj" wrote : I guess this is gonna be log.trace or removed?
its already removed, totally forgot to remove them.
"alesj" wrote :
| | public class DummyClassPoolFactory implements ClassPoolFactory
| | {
| |
| | public ClassPool getPoolForLoader(ClassLoader cl)
| | {
| | return ClassPool.getDefault();
| | }
| |
| | }
| |
| Why Dummy if it's default?
i made those in the beginning hoping that kabir would finish his classloading stuff before i added this to trunk. when it didnt happen i kept the dummy just to show that this is something that will be changed later. this isnt something that is exposed to the user, so i felt it was ok to just leave it.
- its the same code that was used earlier though, so it works like before.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4218516#4218516
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4218516
17 years
[Design of JBoss jBPM] - programmatic passing of environment objects
by tom.baeyens@jboss.com
there are some situations where we need to support passing of environment objects into the service method invocations:
* user provided JDBC connection
* user provided hibernate session
* programmatic specification of the current authenticated user
Of coure, we should not add those as optional parameters to all our service method invocations.
One solution I thought of was something like this:
/** the {@link TaskService task service} that exposes the
| * runtime human task lists. */
| TaskService getTaskService();
|
| /** the {@link TaskService task service} and supply some
| * transactional resources. The given transactional resources will only
| * be associated to the returned task service. */
| TaskService getTaskService(Map<String, Object> envObjects);
|
that way, environment objects could be passed in to the service objects. TaskServices that are created with the second method would typically be used for only one invocation as transactional resources are passed into it.
Still trying to figure out how we can cleanly handle typed objects... When the engine e.g. gets the Authentication with Environment.getFromCurrent(Authentication.class) then we should be able to do something like:
Map<String, Object> envObjects = new HashMap<String, Object>();
| envObjects.put("authentication", new UserProvidedAuthentication("johndoe"));
| TaskService taskService = processEngine.getTaskService(envObjects);
| taskService.take(taskdbid);
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4218513#4218513
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4218513
17 years