[jbpm-commits] JBoss JBPM SVN: r5489 - in jbpm4/branches/tbaeyens/modules/pvm/src/main: java/org/jbpm/pvm/internal/wire/descriptor and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Aug 18 10:05:46 EDT 2009


Author: tom.baeyens at jboss.com
Date: 2009-08-18 10:05:46 -0400 (Tue, 18 Aug 2009)
New Revision: 5489

Modified:
   jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java
   jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/CommandServiceDescriptor.java
   jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.tx.cmd.cfg.xml
Log:
fixed command based interceptor stack

Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java	2009-08-18 10:34:02 UTC (rev 5488)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java	2009-08-18 14:05:46 UTC (rev 5489)
@@ -42,8 +42,8 @@
 import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.cmd.CommandService;
 import org.jbpm.pvm.internal.env.Context;
-import org.jbpm.pvm.internal.env.EnvironmentImpl;
 import org.jbpm.pvm.internal.env.EnvironmentFactory;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
 import org.jbpm.pvm.internal.env.JbpmConfigurationParser;
 import org.jbpm.pvm.internal.env.PvmEnvironment;
 import org.jbpm.pvm.internal.env.UserProvidedEnvironmentObject;
@@ -53,9 +53,6 @@
 import org.jbpm.pvm.internal.stream.StreamInput;
 import org.jbpm.pvm.internal.stream.StringStreamInput;
 import org.jbpm.pvm.internal.stream.UrlStreamInput;
-import org.jbpm.pvm.internal.svc.DefaultCommandService;
-import org.jbpm.pvm.internal.svc.EnvironmentInterceptor;
-import org.jbpm.pvm.internal.tx.StandardTransactionInterceptor;
 import org.jbpm.pvm.internal.wire.WireContext;
 import org.jbpm.pvm.internal.wire.WireDefinition;
 import org.jbpm.pvm.internal.wire.descriptor.ProvidedObjectDescriptor;
@@ -102,6 +99,8 @@
   protected ThreadLocal<List<UserProvidedEnvironmentObject>> userProvidedEnvironmentObjectsThreadLocal = new ThreadLocal<List<UserProvidedEnvironmentObject>>();
   protected ThreadLocal<String> authenticatedUserIdThreadLocal = new ThreadLocal<String>();
   
+  protected CommandService userCommandService = null;
+  
   public JbpmConfiguration() {
     super((Configuration)null);
   }
@@ -130,6 +129,7 @@
         }
       }
     }
+    userCommandService = (CommandService) processEngineWireContext.get("user.command.service");
     return this;
   }
 
@@ -320,20 +320,10 @@
     environmentObjects.add(userProvidedEnvironmentObject);
   }
 
-  EnvironmentInterceptor environmentInterceptor = new EnvironmentInterceptor();
-  StandardTransactionInterceptor standardTransactionInterceptor = new StandardTransactionInterceptor();
-  DefaultCommandService defaultCommandService = new DefaultCommandService();
-  
-  {
-    environmentInterceptor.setNext(standardTransactionInterceptor);
-    environmentInterceptor.setEnvironmentFactory(this);
-    standardTransactionInterceptor.setNext(defaultCommandService);
-  }
-  
   public <T> T execute(Command<T> command) {
     EnvironmentImpl environment = openEnvironment();
     try {
-      return environmentInterceptor.execute(command);
+      return userCommandService.execute(command);
     } catch (RuntimeException e) {
       throw e;
     } catch (Exception e) {

Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/CommandServiceDescriptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/CommandServiceDescriptor.java	2009-08-18 10:34:02 UTC (rev 5488)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/CommandServiceDescriptor.java	2009-08-18 14:05:46 UTC (rev 5489)
@@ -54,7 +54,7 @@
   }
   
   public Class< ? > getType(WireDefinition wireDefinition) {
-    return CommandService.class;
+    return (name==null ? CommandService.class : null);
   }
   
   public void addInterceptorDescriptor(Descriptor descriptor) {

Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.tx.cmd.cfg.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.tx.cmd.cfg.xml	2009-08-18 10:34:02 UTC (rev 5488)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.tx.cmd.cfg.xml	2009-08-18 14:05:46 UTC (rev 5489)
@@ -3,6 +3,11 @@
 <jbpm-configuration>
 
   <process-engine-context>
+    <command-service name="user.command.service">
+      <retry-interceptor />
+      <environment-interceptor />
+      <standard-transaction-interceptor />
+    </command-service>
     <command-service />
   </process-engine-context>
 



More information about the jbpm-commits mailing list