[jbpm-commits] JBoss JBPM SVN: r1974 - in jbpm3/branches/jpdl-3.2.3.CP/bpel: console/src/main/resources/web and 4 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Aug 21 20:12:33 EDT 2008


Author: alex.guizar at jboss.com
Date: 2008-08-21 20:12:33 -0400 (Thu, 21 Aug 2008)
New Revision: 1974

Added:
   jbpm3/branches/jpdl-3.2.3.CP/bpel/console/src/main/java/org/jbpm/bpel/web/JbpmConfigurationLoader.java
Modified:
   jbpm3/branches/jpdl-3.2.3.CP/bpel/console/src/main/java/org/jbpm/bpel/web/AdministrationServlet.java
   jbpm3/branches/jpdl-3.2.3.CP/bpel/console/src/main/java/org/jbpm/bpel/web/DeploymentServlet.java
   jbpm3/branches/jpdl-3.2.3.CP/bpel/console/src/main/resources/web/jboss-web.xml
   jbpm3/branches/jpdl-3.2.3.CP/bpel/console/src/main/resources/web/web.xml
   jbpm3/branches/jpdl-3.2.3.CP/bpel/enterprise/build.xml
   jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/config/jbpm.cfg.xml
   jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/config/jbpm.hibernate.cfg.xml
   jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/java/org/jbpm/bpel/integration/jms/IntegrationControl.java
   jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/java/org/jbpm/bpel/integration/jms/JmsIntegrationService.java
   jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/java/org/jbpm/bpel/integration/jms/JmsIntegrationServiceFactory.java
   jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/java/org/jbpm/bpel/integration/jms/StartListener.java
   jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/java/org/jbpm/bpel/integration/server/SoapHandler.java
Log:
incorporate jPDL 3.2.3 enterprise enhancements: BPEL-297

Modified: jbpm3/branches/jpdl-3.2.3.CP/bpel/console/src/main/java/org/jbpm/bpel/web/AdministrationServlet.java
===================================================================
--- jbpm3/branches/jpdl-3.2.3.CP/bpel/console/src/main/java/org/jbpm/bpel/web/AdministrationServlet.java	2008-08-22 00:04:33 UTC (rev 1973)
+++ jbpm3/branches/jpdl-3.2.3.CP/bpel/console/src/main/java/org/jbpm/bpel/web/AdministrationServlet.java	2008-08-22 00:12:33 UTC (rev 1974)
@@ -1,3 +1,17 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the JBPM BPEL PUBLIC LICENSE AGREEMENT as
+ * published by JBoss Inc.; either version 1.0 of the License, or
+ * (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
 package org.jbpm.bpel.web;
 
 import java.io.IOException;

Modified: jbpm3/branches/jpdl-3.2.3.CP/bpel/console/src/main/java/org/jbpm/bpel/web/DeploymentServlet.java
===================================================================
--- jbpm3/branches/jpdl-3.2.3.CP/bpel/console/src/main/java/org/jbpm/bpel/web/DeploymentServlet.java	2008-08-22 00:04:33 UTC (rev 1973)
+++ jbpm3/branches/jpdl-3.2.3.CP/bpel/console/src/main/java/org/jbpm/bpel/web/DeploymentServlet.java	2008-08-22 00:12:33 UTC (rev 1974)
@@ -1,3 +1,17 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the JBPM BPEL PUBLIC LICENSE AGREEMENT as
+ * published by JBoss Inc.; either version 1.0 of the License, or
+ * (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
 package org.jbpm.bpel.web;
 
 import java.io.File;
@@ -21,6 +35,7 @@
 
 import org.jbpm.JbpmConfiguration;
 import org.jbpm.JbpmContext;
+import org.jbpm.bpel.BpelException;
 import org.jbpm.bpel.graph.def.BpelProcessDefinition;
 import org.jbpm.bpel.persistence.db.BpelGraphSession;
 import org.jbpm.bpel.tools.WebModuleBuilder;
@@ -93,10 +108,7 @@
     FileItem fileItem = (FileItem) request.getAttribute(PARAM_PROCESS_ARCHIVE);
     String fileName = extractFileName(fileItem.getName());
     ProcessDefinition processDefinition = readProcessDefinition(fileItem.getInputStream(), fileName);
-    deployProcessDefinition(processDefinition);
-    // build and deploy web module, if the language is BPEL
-    if (processDefinition instanceof BpelProcessDefinition)
-      deployWebModule((BpelProcessDefinition) processDefinition, fileName);
+    deployProcessDefinition(processDefinition, fileName);
     // transfer web flow
     response.sendRedirect("processes.jsp");
   }
@@ -150,11 +162,12 @@
 
   private static String extractFileName(String filePath) {
     /*
-     * PORTABILITY INFO. Some browsers (e.g. internet explorer) send the file's absolute path. If
-     * this servlet ran on the client side, it could leverage the File class to extract the file
-     * name. However, since the separator char may differ between the client and the server, File is
-     * not reliable. This code splits the path around matches of all known file separators and takes
-     * the last fragment as the file name.
+     * PORTABILITY INFO. Some browsers (e.g. internet explorer) send the file's
+     * absolute path. If this servlet ran on the client side, it could leverage
+     * the File class to extract the file name. However, since the separator
+     * char may differ between the client and the server, File is not reliable.
+     * This code splits the path around matches of all known file separators and
+     * takes the last fragment as the file name.
      */
     String[] fragments = fileSeparatorPattern.split(filePath);
     return fragments[fragments.length - 1];
@@ -176,15 +189,18 @@
     }
   }
 
-  private void deployProcessDefinition(ProcessDefinition processDefinition) {
+  private void deployProcessDefinition(ProcessDefinition processDefinition, String fileName) {
     JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
     try {
       if (processDefinition instanceof BpelProcessDefinition) {
-        BpelGraphSession graphSession = BpelGraphSession.getContextInstance(jbpmContext);
-        graphSession.deployProcessDefinition((BpelProcessDefinition) processDefinition);
+        BpelProcessDefinition bpelProcessDefinition = (BpelProcessDefinition) processDefinition;
+        BpelGraphSession.getContextInstance(jbpmContext).deployProcessDefinition(
+            bpelProcessDefinition);
+        deployWebModule(bpelProcessDefinition, fileName);
       }
-      else
+      else {
         jbpmContext.deployProcessDefinition(processDefinition);
+      }
       log.info("deployed process definition: " + processDefinition.getName());
     }
     catch (RuntimeException e) {
@@ -196,8 +212,7 @@
     }
   }
 
-  private void deployWebModule(BpelProcessDefinition processDefinition, String fileName)
-      throws ServletException {
+  private void deployWebModule(BpelProcessDefinition processDefinition, String fileName) {
     File moduleFile = new File(deployDirectory, extractFilePrefix(fileName) + ".war");
 
     WebModuleBuilder builder = new WebModuleBuilder();
@@ -205,7 +220,7 @@
     builder.buildModule(processDefinition);
 
     if (builder.getProblemHandler().getProblemCount() > 0)
-      throw new ServletException("could not build web module for: " + processDefinition);
+      throw new BpelException("could not build web module for: " + processDefinition);
 
     log.info("deployed web module: " + moduleFile.getName());
   }

Added: jbpm3/branches/jpdl-3.2.3.CP/bpel/console/src/main/java/org/jbpm/bpel/web/JbpmConfigurationLoader.java
===================================================================
--- jbpm3/branches/jpdl-3.2.3.CP/bpel/console/src/main/java/org/jbpm/bpel/web/JbpmConfigurationLoader.java	                        (rev 0)
+++ jbpm3/branches/jpdl-3.2.3.CP/bpel/console/src/main/java/org/jbpm/bpel/web/JbpmConfigurationLoader.java	2008-08-22 00:12:33 UTC (rev 1974)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the JBPM BPEL PUBLIC LICENSE AGREEMENT as
+ * published by JBoss Inc.; either version 1.0 of the License, or
+ * (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+package org.jbpm.bpel.web;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import org.jbpm.JbpmConfiguration;
+import org.jbpm.JbpmContext;
+import org.jbpm.bpel.integration.IntegrationService;
+import org.jbpm.svc.Services;
+
+/**
+ * Loads and closes the {@linkplain JbpmConfiguration jBPM configuration} when
+ * the servlet context is initialized and destroyed, respectively.
+ * <h3>Configuration</h3>
+ * Servlet context init parameters 
+ * <table border="1">
+ * <tr>
+ * <th>Name</th>
+ * <th>Description</th>
+ * <th>Default value</th>
+ * </tr>
+ * <tr>
+ * <td>jbpm.configuration.resource</td>
+ * <td>name of the resource that defines the jBPM configuration</td>
+ * <td>jbpm.cfg.xml</td>
+ * </tr>
+ * </table>
+ * @author Alejandro Guizar
+ */
+public class JbpmConfigurationLoader implements ServletContextListener {
+
+  public void contextInitialized(ServletContextEvent event) {
+    String resource = event.getServletContext().getInitParameter("jbpm.configuration.resource");
+    JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance(resource);
+    // force services to initialize here
+    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
+    try {
+      Services services = jbpmContext.getServices();
+      services.getPersistenceService();
+      services.getMessageService();
+      services.getSchedulerService();
+      services.getService(IntegrationService.SERVICE_NAME);
+    }
+    finally {
+      jbpmContext.close();
+    }
+  }
+
+  public void contextDestroyed(ServletContextEvent event) {
+    String resource = event.getServletContext().getInitParameter("jbpm.configuration.resource");
+    JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance(resource);
+    jbpmConfiguration.close();
+  }
+
+}

Modified: jbpm3/branches/jpdl-3.2.3.CP/bpel/console/src/main/resources/web/jboss-web.xml
===================================================================
--- jbpm3/branches/jpdl-3.2.3.CP/bpel/console/src/main/resources/web/jboss-web.xml	2008-08-22 00:04:33 UTC (rev 1973)
+++ jbpm3/branches/jpdl-3.2.3.CP/bpel/console/src/main/resources/web/jboss-web.xml	2008-08-22 00:12:33 UTC (rev 1974)
@@ -16,13 +16,13 @@
   </resource-ref>
 
   <message-destination-ref>
-    <message-destination-ref-name>jms/JbpmRequestQueue</message-destination-ref-name>
-    <jndi-name>queue/A</jndi-name>
+    <message-destination-ref-name>jms/RequestQueue</message-destination-ref-name>
+    <jndi-name>queue/JbpmRequestQueue</jndi-name>
   </message-destination-ref>
 
   <message-destination-ref>
-    <message-destination-ref-name>jms/JbpmResponseQueue</message-destination-ref-name>
-    <jndi-name>queue/B</jndi-name>
+    <message-destination-ref-name>jms/ResponseQueue</message-destination-ref-name>
+    <jndi-name>queue/JbpmResponseQueue</jndi-name>
   </message-destination-ref>
 
 </jboss-web>

Modified: jbpm3/branches/jpdl-3.2.3.CP/bpel/console/src/main/resources/web/web.xml
===================================================================
--- jbpm3/branches/jpdl-3.2.3.CP/bpel/console/src/main/resources/web/web.xml	2008-08-22 00:04:33 UTC (rev 1973)
+++ jbpm3/branches/jpdl-3.2.3.CP/bpel/console/src/main/resources/web/web.xml	2008-08-22 00:12:33 UTC (rev 1974)
@@ -33,6 +33,14 @@
     <url-pattern>/registration</url-pattern>
   </servlet-mapping>
 
+  <listener>
+    <description>
+      Loads and closes the jBPM configuration when the servlet context is initialized and
+      destroyed, respectively.
+    </description>
+    <listener-class>org.jbpm.bpel.web.JbpmConfigurationLoader</listener-class>
+  </listener>
+
   <resource-ref>
     <description>
       Logical name of the data source that provides connections to the persistence service.
@@ -80,13 +88,13 @@
   </message-destination-ref>
 
   <message-destination-ref>
-    <message-destination-ref-name>jms/JbpmRequestQueue</message-destination-ref-name>
+    <message-destination-ref-name>jms/RequestQueue</message-destination-ref-name>
     <message-destination-type>javax.jms.Queue</message-destination-type>
     <message-destination-usage>ConsumesProduces</message-destination-usage>
   </message-destination-ref>
 
   <message-destination-ref>
-    <message-destination-ref-name>jms/JbpmResponseQueue</message-destination-ref-name>
+    <message-destination-ref-name>jms/ResponseQueue</message-destination-ref-name>
     <message-destination-type>javax.jms.Queue</message-destination-type>
     <message-destination-usage>ConsumesProduces</message-destination-usage>
   </message-destination-ref>

Modified: jbpm3/branches/jpdl-3.2.3.CP/bpel/enterprise/build.xml
===================================================================
--- jbpm3/branches/jpdl-3.2.3.CP/bpel/enterprise/build.xml	2008-08-22 00:04:33 UTC (rev 1973)
+++ jbpm3/branches/jpdl-3.2.3.CP/bpel/enterprise/build.xml	2008-08-22 00:12:33 UTC (rev 1974)
@@ -86,6 +86,14 @@
       <replacetoken><![CDATA[==== DataSource properties (end)]]></replacetoken>
       <replacevalue><![CDATA[<!-- DataSource properties (end)]]></replacevalue>
     </replace>
+    <replace file="target/config/jbpm.hibernate.cfg.xml">
+      <replacetoken><![CDATA[JTA transaction properties (begin) ===]]></replacetoken>
+      <replacevalue><![CDATA[JTA transaction properties (begin) -->]]></replacevalue>
+    </replace>
+    <replace file="target/config/jbpm.hibernate.cfg.xml">
+      <replacetoken><![CDATA[==== JTA transaction properties (end)]]></replacetoken>
+      <replacevalue><![CDATA[<!-- JTA transaction properties (end)]]></replacevalue>
+    </replace>
 
     <!-- include identity mappings -->
     <replace file="target/config/jbpm.hibernate.cfg.xml">
@@ -164,7 +172,7 @@
 
   <target name="undeploy.ear"
           description="undeploy enterprise application from server">
-    <delete file="${jboss.home}/server/${jboss.server}/deploy/${lib.jbpm.bpel.application.name}" />
+    <delete file="${jboss.home}/server/${jboss.server}/deploy/${lib.jbpm.bpel.enterprise.file}" />
   </target>
 
 </project>
\ No newline at end of file

Modified: jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/config/jbpm.cfg.xml
===================================================================
--- jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/config/jbpm.cfg.xml	2008-08-22 00:04:33 UTC (rev 1973)
+++ jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/config/jbpm.cfg.xml	2008-08-22 00:12:33 UTC (rev 1974)
@@ -22,6 +22,9 @@
       <factory>
         <bean class="org.jbpm.bpel.integration.jms.JmsIntegrationServiceFactory">
           <field name="jbpmConfiguration"><ref bean="jbpmConfiguration" /></field>
+          <field name="connectionFactoryName"><string value="java:ConnectionFactory"/></field>
+          <field name="requestDestinationName"><string value="queue/A"/></field>
+          <field name="responseDestinationName"><string value="queue/B"/></field>
         </bean>
       </factory>
     </service>
@@ -53,8 +56,9 @@
   <string name="resource.endpoint.metadata.lookups" value="org/jbpm/bpel/integration/server/endpoint.metadata.lookups.xml" />
 
   <!-- compression level applied to xml fragments stored in the database -->
-  <!-- see java.util.zip.Deflater for a description of the allowed values -->
-  <int name="jbpm.bpel.xml.deflate.level" value="0" singleton="true" />
+  <!-- see java.util.zip.Deflater for a description of the allowed values
+  <int name="jbpm.bpel.xml.deflate.level" value="5" />
+  -->
 
   <bean name="jbpm.bpel.central.catalog" class="org.jbpm.bpel.integration.catalog.CentralCatalog"
     singleton="true">

Modified: jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/config/jbpm.hibernate.cfg.xml
===================================================================
--- jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/config/jbpm.hibernate.cfg.xml	2008-08-22 00:04:33 UTC (rev 1973)
+++ jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/config/jbpm.hibernate.cfg.xml	2008-08-22 00:12:33 UTC (rev 1974)
@@ -26,7 +26,6 @@
     <!-- JTA transaction properties (begin) ===
     <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
     <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
-    <property name="jta.UserTransaction">UserTransaction</property>
     ==== JTA transaction properties (end) -->
 
     <!-- logging properties (begin) -->

Modified: jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/java/org/jbpm/bpel/integration/jms/IntegrationControl.java
===================================================================
--- jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/java/org/jbpm/bpel/integration/jms/IntegrationControl.java	2008-08-22 00:04:33 UTC (rev 1973)
+++ jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/java/org/jbpm/bpel/integration/jms/IntegrationControl.java	2008-08-22 00:12:33 UTC (rev 1974)
@@ -25,6 +25,7 @@
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.JMSException;
+import javax.jms.Session;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
@@ -64,7 +65,7 @@
 import org.jbpm.svc.Services;
 
 /**
- * @author Alejandro Guízar
+ * @author Alejandro Guizar
  * @version $Revision$ $Date: 2008/01/30 07:18:22 $
  */
 public class IntegrationControl {
@@ -106,6 +107,10 @@
     return jmsConnection;
   }
 
+  public Session createJmsSession() throws JMSException {
+    return jmsConnection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
+  }
+
   public DeploymentDescriptor getDeploymentDescriptor() {
     return deploymentDescriptor;
   }

Modified: jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/java/org/jbpm/bpel/integration/jms/JmsIntegrationService.java
===================================================================
--- jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/java/org/jbpm/bpel/integration/jms/JmsIntegrationService.java	2008-08-22 00:04:33 UTC (rev 1973)
+++ jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/java/org/jbpm/bpel/integration/jms/JmsIntegrationService.java	2008-08-22 00:12:33 UTC (rev 1974)
@@ -48,7 +48,7 @@
 import org.jbpm.graph.exe.Token;
 
 /**
- * @author Alejandro Guízar
+ * @author Alejandro Guizar
  * @version $Revision$ $Date: 2008/01/30 07:18:22 $
  */
 public class JmsIntegrationService implements IntegrationService {
@@ -76,7 +76,7 @@
 
   void jmsReceive(ReceiveAction receiveAction, Token token, IntegrationControl integrationControl,
       boolean oneShot) throws JMSException {
-    Session jmsSession = createJmsSession(integrationControl);
+    Session jmsSession = integrationControl.createJmsSession();
     RequestListener requestListener = new RequestListener(receiveAction, token, integrationControl,
         jmsSession, oneShot);
     requestListeners.add(requestListener);
@@ -94,7 +94,7 @@
 
   void jmsReceive(List receivers, Token token, IntegrationControl integrationControl)
       throws JMSException {
-    Session jmsSession = createJmsSession(integrationControl);
+    Session jmsSession = integrationControl.createJmsSession();
     Iterator receiverIt = receivers.iterator();
     while (receiverIt.hasNext()) {
       ReceiveAction receiveAction = (ReceiveAction) receiverIt.next();
@@ -104,11 +104,6 @@
     }
   }
 
-  private static Session createJmsSession(IntegrationControl integrationControl)
-      throws JMSException {
-    return integrationControl.getJmsConnection().createSession(false, Session.CLIENT_ACKNOWLEDGE);
-  }
-
   public void cancelReception(ReceiveAction receiveAction, Token token) {
     try {
       jmsCancelReception(receiveAction, token, getIntegrationControl(token));
@@ -136,14 +131,14 @@
 
   public void reply(ReplyAction replyAction, Token token) {
     try {
-      replyOutstandingRequest(replyAction, token);
+      jmsReply(replyAction, token);
     }
     catch (JMSException e) {
       throw new BpelException("could not send reply", e);
     }
   }
 
-  private void replyOutstandingRequest(ReplyAction replyAction, Token token) throws JMSException {
+  private void jmsReply(ReplyAction replyAction, Token token) throws JMSException {
     // extract the output parts
     Map parts = replyAction.writeMessage(token);
 
@@ -152,7 +147,7 @@
     IntegrationControl integrationControl = getIntegrationControl(token);
     OutstandingRequest request = integrationControl.removeOutstandingRequest(replyAction, token);
 
-    Session jmsSession = createJmsSession(integrationControl);
+    Session jmsSession = integrationControl.createJmsSession();
     try {
       request.sendReply(parts, replyAction.getFaultName(), jmsSession);
     }

Modified: jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/java/org/jbpm/bpel/integration/jms/JmsIntegrationServiceFactory.java
===================================================================
--- jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/java/org/jbpm/bpel/integration/jms/JmsIntegrationServiceFactory.java	2008-08-22 00:04:33 UTC (rev 1973)
+++ jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/java/org/jbpm/bpel/integration/jms/JmsIntegrationServiceFactory.java	2008-08-22 00:12:33 UTC (rev 1974)
@@ -21,6 +21,7 @@
 import javax.jms.ConnectionFactory;
 import javax.jms.Destination;
 import javax.jms.JMSException;
+import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 
@@ -35,7 +36,7 @@
 import org.jbpm.svc.ServiceFactory;
 
 /**
- * @author Alejandro Guízar
+ * @author Alejandro Guizar
  * @version $Revision$ $Date: 2008/06/12 08:18:54 $
  */
 public class JmsIntegrationServiceFactory implements ServiceFactory {
@@ -43,8 +44,8 @@
   // injected objects, see jbpm.cfg.xml
   private JbpmConfiguration jbpmConfiguration;
   private String connectionFactoryName = "java:comp/env/jms/JbpmConnectionFactory";
-  private String requestDestinationName = "java:comp/env/jms/JbpmRequestQueue";
-  private String responseDestinationName = "java:comp/env/jms/JbpmResponseQueue";
+  private String requestDestinationName = "java:comp/env/jms/RequestQueue";
+  private String responseDestinationName = "java:comp/env/jms/ResponseQueue";
 
   private ConnectionFactory connectionFactory;
   private Destination requestDestination;
@@ -71,6 +72,18 @@
     }
   }
 
+  public void setConnectionFactoryName(String connectionFactoryName) {
+    this.connectionFactoryName = connectionFactoryName;
+  }
+
+  public void setRequestDestinationName(String requestDestinationName) {
+    this.requestDestinationName = requestDestinationName;
+  }
+
+  public void setResponseDestinationName(String responseDestinationName) {
+    this.responseDestinationName = responseDestinationName;
+  }
+
   public JbpmConfiguration getJbpmConfiguration() {
     return jbpmConfiguration;
   }
@@ -116,7 +129,7 @@
   }
 
   private static Object lookup(String name) throws NamingException {
-    InitialContext initialContext = new InitialContext();
+    Context initialContext = new InitialContext();
     try {
       return initialContext.lookup(name);
     }
@@ -126,13 +139,13 @@
   }
 
   public IntegrationControl getIntegrationControl(ProcessDefinition processDefinition) {
-    Long processId = new Long(processDefinition.getId());
+    Long processDefinitionId = new Long(processDefinition.getId());
     synchronized (integrationControls) {
-      IntegrationControl integrationControl = (IntegrationControl) integrationControls.get(processId);
+      IntegrationControl integrationControl = (IntegrationControl) integrationControls.get(processDefinitionId);
       if (integrationControl == null) {
         log.debug("creating integration control: processDefinition=" + processDefinition);
         integrationControl = new IntegrationControl(this);
-        integrationControls.put(processId, integrationControl);
+        integrationControls.put(processDefinitionId, integrationControl);
       }
       return integrationControl;
     }

Modified: jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/java/org/jbpm/bpel/integration/jms/StartListener.java
===================================================================
--- jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/java/org/jbpm/bpel/integration/jms/StartListener.java	2008-08-22 00:04:33 UTC (rev 1973)
+++ jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/java/org/jbpm/bpel/integration/jms/StartListener.java	2008-08-22 00:12:33 UTC (rev 1974)
@@ -41,7 +41,7 @@
 import org.jbpm.graph.exe.Token;
 
 /**
- * @author Alejandro Guízar
+ * @author Alejandro Guizar
  * @version $Revision$ $Date: 2008/06/12 08:18:54 $
  */
 public class StartListener implements MessageListener {
@@ -65,8 +65,7 @@
     // save integration control
     this.integrationControl = integrationControl;
 
-    jmsSession = integrationControl.getJmsConnection().createSession(false,
-        Session.CLIENT_ACKNOWLEDGE);
+    jmsSession = integrationControl.createJmsSession();
 
     // create message consumer
     Destination destination = integrationControl.getPartnerLinkEntry(receiveAction.getPartnerLink())
@@ -98,8 +97,7 @@
 
     this.integrationControl = other.integrationControl;
 
-    jmsSession = integrationControl.getJmsConnection().createSession(false,
-        Session.CLIENT_ACKNOWLEDGE);
+    jmsSession = integrationControl.createJmsSession();
     messageConsumer = jmsSession.createConsumer(getDestination(other.messageConsumer),
         other.messageConsumer.getMessageSelector());
 

Modified: jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/java/org/jbpm/bpel/integration/server/SoapHandler.java
===================================================================
--- jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/java/org/jbpm/bpel/integration/server/SoapHandler.java	2008-08-22 00:04:33 UTC (rev 1973)
+++ jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/main/java/org/jbpm/bpel/integration/server/SoapHandler.java	2008-08-22 00:12:33 UTC (rev 1974)
@@ -77,7 +77,7 @@
 import org.jbpm.util.ClassLoaderUtil;
 
 /**
- * @author Alejandro Guízar
+ * @author Alejandro Guizar
  * @version $Revision$ $Date: 2007/11/25 13:06:55 $
  */
 public class SoapHandler implements Handler {
@@ -159,8 +159,7 @@
         .getJbpmConfiguration()
         .createJbpmContext();
     try {
-      Session jmsSession = integrationControl.getJmsConnection().createSession(false,
-          Session.CLIENT_ACKNOWLEDGE);
+      Session jmsSession = integrationControl.createJmsSession();
       try {
         SOAPMessage soapMessage = ((SOAPMessageContext) messageContext).getMessage();
         ObjectMessage jmsRequest = sendRequest(soapMessage, jmsSession, jbpmContext);




More information about the jbpm-commits mailing list