1 17 package org.apache.servicemix.wsn.jms; 18 19 import javax.jms.Connection ; 20 import javax.jms.ConnectionFactory ; 21 22 import org.apache.servicemix.wsn.AbstractCreatePullPoint; 23 import org.apache.servicemix.wsn.AbstractPullPoint; 24 25 public class JmsCreatePullPoint extends AbstractCreatePullPoint { 26 27 private ConnectionFactory connectionFactory; 28 private Connection connection; 29 30 public JmsCreatePullPoint(String name) { 31 super(name); 32 } 33 34 public void init() throws Exception { 35 if (connection == null) { 36 connection = connectionFactory.createConnection(); 37 connection.start(); 38 } 39 super.init(); 40 } 41 42 @Override 43 protected AbstractPullPoint createPullPoint(String name) { 44 JmsPullPoint pullPoint = new JmsPullPoint(name); 45 pullPoint.setManager(getManager()); 46 pullPoint.setConnection(connection); 47 return pullPoint; 48 } 49 50 public ConnectionFactory getConnectionFactory() { 51 return connectionFactory; 52 } 53 54 public void setConnectionFactory(ConnectionFactory connectionFactory) { 55 this.connectionFactory = connectionFactory; 56 } 57 58 } 59 | Popular Tags |