Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   * JBoss, Home of Professional Open Source
   * Copyright 2005, JBoss Inc., and individual contributors as indicated
   * by the @authors tag. See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 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
  * Lesser General Public License for more details.
  * You should have received a copy of the GNU Lesser General Public
  * License along with this software; if not, write to the Free
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site:
 package org.jbpm.jms;
 import  javax.jms.ConnectionFactory;
 import  javax.jms.Destination;
 import  javax.jms.JMSException;
The JMS connector service leverages the reliable communication infrastructure available through JMS interfaces to deliver asynchronous continuation messages to the JobListenerBean.


The JMS connector service factory exposes the following configurable fields.
  • connectionFactoryJndiName
  • destinationJndiName
  • isCommitEnabled
Refer to the jBPM manual for details.

Tom Baeyens
Alejandro Guizar
 public class JmsConnectorServiceFactory implements ServiceFactory {
   private static final long serialVersionUID = 1L;
   private String connectionFactoryJndiName = "java:comp/env/jms/JbpmConnectionFactory";
   private String destinationJndiName = "java:comp/env/jms/JobQueue";
   public void setConnectionFactoryJndiName(String connectionFactoryJndiName) {
 	this. = connectionFactoryJndiName;
   public void setDestinationJndiName(String destinationJndiName) {
 	this. = destinationJndiName;
   private ConnectionFactory connectionFactory;
   private Destination destination;
   public synchronized ConnectionFactory getConnectionFactory() {
     if ( == null) {
        = (ConnectionFactory) JndiUtil.lookup(, ConnectionFactory.class);
     return ;
   public synchronized Destination getDestination() {
     if ( == null) {
        = (Destination) JndiUtil.lookup(, Destination.class);
     return ;
     // in case this field is not initialized in jbpm configuration
     if ( == null) {
       JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
       if (jbpmContext == nullthrow new JbpmException("no active jbpm context");
        = jbpmContext.getJbpmConfiguration();
     return ;
   public Service openService() {
    try {
      return new JmsConnectorService(this);
    catch (JMSException e) {
      throw new JbpmException("could not open message service"e);
  public void close() {
     = null;
     = null;
New to GrepCode? Check out our FAQ X