1 22 package org.objectweb.petals.binding.jms; 23 24 import java.util.HashMap ; 25 import java.util.Map ; 26 27 import org.objectweb.petals.binding.jms.incoming.JMSExternalListenerManager; 28 import org.objectweb.petals.binding.jms.outgoing.JBIListener; 29 import org.objectweb.petals.binding.jms.su.JMSServiceUnitListener; 30 import org.objectweb.petals.component.common.bc.AbstractBindingComponent; 31 import org.objectweb.petals.component.common.bc.ExternalListenerManager; 32 33 38 public class JmsBC extends AbstractBindingComponent { 39 40 44 private Map <String , JMSConnection> jmsProducerConnections; 45 46 50 private Map <String , JMSConnection> jmsConsumerConnections; 51 52 @Override 53 protected void init(BindingComponentInitializer initializer) { 54 55 jmsProducerConnections = new HashMap <String , JMSConnection>(); 56 jmsConsumerConnections = new HashMap <String , JMSConnection>(); 57 58 JMSServiceUnitListener suListener = new JMSServiceUnitListener( 60 jmsProducerConnections, jmsConsumerConnections); 61 setServiceUnitListener(suListener); 62 63 org.objectweb.petals.component.common.bc.JBIListener jbiListener = new JBIListener( 64 jmsProducerConnections, getLogger()); 65 ExternalListenerManager jmsListenerManager = new JMSExternalListenerManager( 66 this, jmsConsumerConnections); 67 68 initializer.setExternalListenerManager(jmsListenerManager); 69 initializer.setJbiListener(jbiListener); 70 71 } 72 73 } 74 | Popular Tags |