KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > common > ejbs > mdb > containermanaged > mdbinterface > MDBInterface00


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: MDBInterface00.java 692 2006-06-20 09:17:57Z studzine $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.common.ejbs.mdb.containermanaged.mdbinterface;
26
27 import static org.objectweb.easybeans.tests.common.ejbs.entity.callbacklogger.CallbackType.UNDEFINED;
28 import static org.objectweb.easybeans.tests.common.ejbs.entity.callbacklogger.OperationType.MESSAGE_DRIVEN_CONTEXT;
29
30 import javax.ejb.ActivationConfigProperty JavaDoc;
31 import javax.ejb.EJBException JavaDoc;
32 import javax.ejb.MessageDriven JavaDoc;
33 import javax.ejb.MessageDrivenBean JavaDoc;
34 import javax.ejb.MessageDrivenContext JavaDoc;
35 import javax.jms.Message JavaDoc;
36 import javax.jms.MessageListener JavaDoc;
37
38 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.callbacklogger.BaseInsertOperation;
39 import org.objectweb.easybeans.tests.common.jms.JMSManager;
40
41 /**
42  * This bean test optional MessageDrivenBean interface.
43  * @author Eduardo Studzinski Estima de Castro
44  * @author Gisele Pinheiro Souza
45  */

46 @MessageDriven JavaDoc(messageListenerInterface = MessageListener JavaDoc.class, activationConfig = {
47         @ActivationConfigProperty JavaDoc(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
48         @ActivationConfigProperty JavaDoc(propertyName = "destination", propertyValue = JMSManager.DEFAULT_QUEUE),
49         @ActivationConfigProperty JavaDoc(propertyName = "messageSelector", propertyValue =
50             "TYPE = 'org.objectweb.easybeans.tests.common.ejbs.mdb.containermanaged.mdbinterface.MDBInterface00'")})
51 public class MDBInterface00 extends BaseInsertOperation implements MessageDrivenBean JavaDoc {
52
53     /**
54      * Message type.
55      */

56     public static final String JavaDoc MESSAGE_TYPE = "org.objectweb.easybeans.tests.common.ejbs.mdb."
57             + "containermanaged.mdbinterface.MDBInterface00";
58
59     /**
60      * ID.
61      */

62     private static final long serialVersionUID = 4108218174206348937L;
63
64     /**
65      * Context.
66      */

67     private MessageDrivenContext JavaDoc ctx;
68
69     /**
70      * Remove method.
71      * @throws EJBException if a problem occurs.
72      */

73     public void ejbRemove() throws EJBException JavaDoc {
74         // TODO: test
75
}
76
77     /**
78      * Sets the message driven context.
79      * @param ctx context
80      */

81     public void setMessageDrivenContext(MessageDrivenContext JavaDoc ctx) throws EJBException JavaDoc {
82         this.ctx = ctx;
83     }
84
85     /**
86      * Verifies MessageDrivenContext methods.
87      * @param message msg
88      */

89     public void onMessage(final Message JavaDoc message) {
90         if (ctx != null) {
91             super.log(MDBInterface00.class, UNDEFINED, MDBInterface00.class, MESSAGE_DRIVEN_CONTEXT);
92         }
93     }
94
95 }
96
Popular Tags