KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > tutorial > jca > inflow > swiftmq > bean > AnnotatedTestMDBBean


1 /*
2 * JBoss, the OpenSource J2EE webOS
3 *
4 * Distributable under LGPL license.
5 * See terms of license at gnu.org.
6 */

7 package org.jboss.tutorial.jca.inflow.swiftmq.bean;
8
9 import org.jboss.annotation.ejb.ResourceAdapter;
10
11 import javax.ejb.*;
12 import javax.jms.Message JavaDoc;
13 import javax.jms.MessageListener JavaDoc;
14
15
16 @MessageDriven(name="testmdb", activationConfig =
17 {
18 @ActivationConfigProperty(propertyName="messagingType", propertyValue="javax.jms.MessageListener"),
19 @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
20 @ActivationConfigProperty(propertyName="Destination", propertyValue="testqueue"),
21 @ActivationConfigProperty(propertyName="ConnectionFactoryName", propertyValue="ConnectionFactory"),
22 @ActivationConfigProperty(propertyName="Transacted", propertyValue="true"),
23 @ActivationConfigProperty(propertyName="Xa", propertyValue="true"),
24 @ActivationConfigProperty(propertyName="DeliveryOption", propertyValue="B"),
25 @ActivationConfigProperty(propertyName="SubscriptionDurability", propertyValue="Durable"),
26 @ActivationConfigProperty(propertyName="MaxPoolSize", propertyValue="20"),
27 @ActivationConfigProperty(propertyName="MaxMessages", propertyValue="1"),
28 })
29 @ResourceAdapter("swiftmq.rar")
30 public class AnnotatedTestMDBBean
31    implements MessageListener JavaDoc
32 {
33    public void onMessage(Message JavaDoc message)
34    {
35       System.out.println(message);
36    }
37 }
38
Popular Tags