[jbpm-commits] JBoss JBPM SVN: r2722 - in jbpm4/trunk/modules/pvm: src/main/java/org/jbpm/cfg and 5 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Oct 31 13:23:36 EDT 2008


Author: tom.baeyens at jboss.com
Date: 2008-10-31 13:23:36 -0400 (Fri, 31 Oct 2008)
New Revision: 2722

Modified:
   jbpm4/trunk/modules/pvm/pom.xml
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/cfg/JbpmConfiguration.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/cfg/SpringConfiguration.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/BasicEnvironment.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ExecutionEnvironment.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorServlet.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironment.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/timer/TimerConfiguration.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ExamplesConfiguration.java
Log:
unification api proposals

Modified: jbpm4/trunk/modules/pvm/pom.xml
===================================================================
--- jbpm4/trunk/modules/pvm/pom.xml	2008-10-31 17:23:16 UTC (rev 2721)
+++ jbpm4/trunk/modules/pvm/pom.xml	2008-10-31 17:23:36 UTC (rev 2722)
@@ -42,9 +42,13 @@
     </dependency>
     <dependency>
       <groupId>org.jbpm.jbpm4</groupId>
-      <artifactId>jbpm-test</artifactId>
+      <artifactId>jbpm-test-base</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.jbpm.jbpm4</groupId>
+      <artifactId>jbpm-log</artifactId>
+    </dependency>
+    <dependency>
       <groupId>log4j</groupId>
       <artifactId>log4j</artifactId>
     </dependency>

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/cfg/JbpmConfiguration.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/cfg/JbpmConfiguration.java	2008-10-31 17:23:16 UTC (rev 2721)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/cfg/JbpmConfiguration.java	2008-10-31 17:23:36 UTC (rev 2722)
@@ -89,6 +89,7 @@
   protected WireDefinition environmentCtxWireDefinition = null;
 
   public JbpmConfiguration() {
+    super((Configuration)null);
   }
 
   public ProcessEngine buildProcessEngine() {
@@ -98,24 +99,29 @@
     return this;
   }
 
-  public void setInputStream(InputStream inputStream) {
+  public Configuration setInputStream(InputStream inputStream) {
     parse(new InputStreamSource(inputStream));
+    return this;
   }
 
-  public void setResource(String resource) {
+  public Configuration setResource(String resource) {
     parse(new ResourceStreamSource(resource, getClassLoader()));
+    return this;
   }
 
-  public void setUrl(URL url) {
+  public Configuration setUrl(URL url) {
     parse(new UrlStreamSource(url));
+    return this;
   }
 
-  public void setFile(File file) {
+  public Configuration setFile(File file) {
     parse(new FileStreamSource(file));
+    return this;
   }
 
-  public void setXmlString(String xmlString) {
+  public Configuration setXmlString(String xmlString) {
     parse(new StringStreamSource(xmlString));
+    return this;
   }
 
   protected void parse(StreamSource streamSource) {
@@ -176,6 +182,8 @@
 
     // finish the creation of the environment wire context
     environmentContext.create();
+    
+    Environment.pushEnvironment(environment);
 
     // if all went well, return the created environment
     return environment;

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/cfg/SpringConfiguration.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/cfg/SpringConfiguration.java	2008-10-31 17:23:16 UTC (rev 2721)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/cfg/SpringConfiguration.java	2008-10-31 17:23:36 UTC (rev 2722)
@@ -37,7 +37,7 @@
  *  
  * @author Tom Baeyens
  */
-public class SpringConfiguration extends EnvironmentFactory implements ApplicationContextAware {
+public class SpringConfiguration implements EnvironmentFactory, ApplicationContextAware {
   
   // TODO pull up the common behaviour between this class and the SpringEnvironmentContext
   

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/BasicEnvironment.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/BasicEnvironment.java	2008-10-31 17:23:16 UTC (rev 2721)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/BasicEnvironment.java	2008-10-31 17:23:36 UTC (rev 2722)
@@ -52,7 +52,6 @@
     contexts = new HashMap<String, Context>();
     defaultSearchOrderList = new ArrayList<String>();
     defaultSearchOrder = null;
-    pushEnvironment(this);
   }
 
   // context methods ////////////////////////////////////////////////////////////

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ExecutionEnvironment.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ExecutionEnvironment.java	2008-10-31 17:23:16 UTC (rev 2721)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ExecutionEnvironment.java	2008-10-31 17:23:36 UTC (rev 2722)
@@ -32,5 +32,6 @@
   
   public ExecutionEnvironment(Execution execution) {
     addContext(new ExecutionContext(execution));
+    pushEnvironment(this);
   }
 }

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorServlet.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorServlet.java	2008-10-31 17:23:16 UTC (rev 2721)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorServlet.java	2008-10-31 17:23:36 UTC (rev 2722)
@@ -29,6 +29,7 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.jbpm.Configuration;
 import org.jbpm.PvmException;
 import org.jbpm.cfg.JbpmConfiguration;
 import org.jbpm.pvm.env.EnvironmentFactory;
@@ -82,7 +83,7 @@
   
   public void init() throws ServletException {
     String configurationResource = getInitParameter("jbpm.configuration.resource", "jbpm.cfg.xml");
-    EnvironmentFactory environmentFactory = new JbpmConfiguration(configurationResource);
+    EnvironmentFactory environmentFactory = (EnvironmentFactory) new Configuration().setResource(configurationResource).buildProcessEngine();
     jobExecutor = environmentFactory.get(JobExecutor.class);
     if (jobExecutor==null) {
       throw new PvmException("no jobImpl executor configured in resource "+configurationResource);

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironment.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironment.java	2008-10-31 17:23:16 UTC (rev 2721)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironment.java	2008-10-31 17:23:36 UTC (rev 2722)
@@ -40,6 +40,7 @@
   public SpringEnvironment(SpringConfiguration springConfiguration) {
     addContext(springConfiguration);
     addContext(new SpringEnvironmentContext(springConfiguration.getApplicationContext()));
+    pushEnvironment(this);
   }
 
   public ClassLoader getClassLoader() {

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/timer/TimerConfiguration.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/timer/TimerConfiguration.java	2008-10-31 17:23:16 UTC (rev 2721)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/timer/TimerConfiguration.java	2008-10-31 17:23:36 UTC (rev 2722)
@@ -1,5 +1,6 @@
  package org.jbpm.pvm.api.timer;
 
+import org.jbpm.Configuration;
 import org.jbpm.ExecutionService;
 import org.jbpm.ManagementService;
 import org.jbpm.ProcessService;
@@ -40,7 +41,7 @@
   private synchronized static void initialize() {
     if (!isInitialized) {
       isInitialized = true;
-      environmentFactory = new JbpmConfiguration("org/jbpm/pvm/timer/environment.cfg.xml");
+      environmentFactory = (EnvironmentFactory) new Configuration().setResource("org/jbpm/pvm/timer/environment.cfg.xml").buildProcessEngine();
       processService = environmentFactory.get(ProcessService.class);
       executionService = environmentFactory.get(ExecutionService.class);
       managementService = environmentFactory.get(ManagementService.class);

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ExamplesConfiguration.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ExamplesConfiguration.java	2008-10-31 17:23:16 UTC (rev 2721)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ExamplesConfiguration.java	2008-10-31 17:23:36 UTC (rev 2722)
@@ -21,6 +21,7 @@
  */
 package org.jbpm.pvm.samples;
 
+import org.jbpm.Configuration;
 import org.jbpm.ExecutionService;
 import org.jbpm.ManagementService;
 import org.jbpm.ProcessService;
@@ -62,7 +63,7 @@
   private synchronized static void initialize() {
     if (!isInitialized) {
       isInitialized = true;
-      environmentFactory = new JbpmConfiguration("environment.cfg.xml");
+      environmentFactory = (EnvironmentFactory) new Configuration().setResource("environment.cfg.xml").buildProcessEngine();
       processService = environmentFactory.get(ProcessService.class);
       executionService = environmentFactory.get(ExecutionService.class);
       managementService = environmentFactory.get(ManagementService.class);




More information about the jbpm-commits mailing list