KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > petals > binding > jms > JmsBC


1 /**
2  * PETALS - PETALS Services Platform.
3  * Copyright (c) 2005 EBM Websourcing, http://www.ebmwebsourcing.com/
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * -------------------------------------------------------------------------
19  * $Id: JmsBC.java 676 2006-06-27 15:44:03Z alouis $
20  * -------------------------------------------------------------------------
21  */

22 package org.objectweb.petals.binding.jms;
23
24 import java.util.HashMap JavaDoc;
25 import java.util.Map JavaDoc;
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 /**
34  * This component is a JMS BC
35  *
36  * @author alouis - eBMWebsourcing
37  */

38 public class JmsBC extends AbstractBindingComponent {
39
40     /**
41      * Contains jmsProducerConnections, stored by 'address' (ie jms url
42      * provider)
43      */

44     private Map JavaDoc<String JavaDoc, JMSConnection> jmsProducerConnections;
45
46     /**
47      * Contains jmsConsumerConnections, stored by 'address' (ie jms url
48      * provider)
49      */

50     private Map JavaDoc<String JavaDoc, JMSConnection> jmsConsumerConnections;
51
52     @Override JavaDoc
53     protected void init(BindingComponentInitializer initializer) {
54
55         jmsProducerConnections = new HashMap JavaDoc<String JavaDoc, JMSConnection>();
56         jmsConsumerConnections = new HashMap JavaDoc<String JavaDoc, JMSConnection>();
57
58         // set the SU listener that will perform extra process on SU deployment
59
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