KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > common > ejbs > mdb > beanmanaged > timer > MDBBeanManagedTimeoutCallbackAccess00


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: MDBBeanManagedTimeoutCallbackAccess00.java 827 2006-07-10 14:12:17Z studzine $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.common.ejbs.mdb.beanmanaged.timer;
26
27 import static org.objectweb.easybeans.tests.common.resources.UserTransactionTester.checkInstance;
28
29 import javax.ejb.ActivationConfigProperty JavaDoc;
30 import javax.ejb.MessageDriven JavaDoc;
31 import javax.ejb.TransactionManagement JavaDoc;
32 import javax.ejb.TransactionManagementType JavaDoc;
33 import javax.jms.MessageListener JavaDoc;
34 import javax.transaction.UserTransaction JavaDoc;
35
36 import org.objectweb.easybeans.tests.common.ejbs.base.timer.BaseTimeoutCallbackAccess;
37 import org.objectweb.easybeans.tests.common.jms.JMSManager;
38
39
40 /**
41  * Performs timeout operations allowed by the specification.
42  * @author Eduardo Studzinski Estima de Castro
43  * @author Gisele Pinheiro Souza
44  *
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 = "TYPE = 'org.objectweb.easybeans.tests."
50         + "common.ejbs.mdb.beanmanaged.timer.MDBBeanManagedTimeoutCallbackAccess00'")})
51 @TransactionManagement JavaDoc(TransactionManagementType.BEAN)
52 public class MDBBeanManagedTimeoutCallbackAccess00 extends BaseTimeoutCallbackAccess{
53
54     /**
55      * Name that will be registered by the operation logger.
56      */

57     public static final String JavaDoc MESSAGE_TYPE = "org.objectweb.easybeans.tests.common.ejbs.mdb.beanmanaged."
58         + "timer.MDBBeanManagedTimeoutCallbackAccess00";
59
60     /**
61      * Gets the bean name.
62      * @return name
63      */

64     @Override JavaDoc
65     public String JavaDoc getName() {
66         return MDBBeanManagedTimeoutCallbackAccess00.class.getName();
67     }
68
69     /**
70      * Tests the UserTransaction.
71      * @param utx instance
72      * @return true if the instance is working properly, otherwise false.
73      */

74     @Override JavaDoc
75     public boolean testUserTransaction(final UserTransaction JavaDoc utx) {
76         try{
77             checkInstance(utx);
78             return true;
79         }catch(Exception JavaDoc e){
80             return false;
81         }
82     }
83
84 }
85
Popular Tags