User: chirino
Date: 01/11/09 15:32:36
Added: src/main/org/jboss/test/mdb/bean TXTimeOutBean.java
Log:
Forgot to commit this file a few days/weeks ago.. sorry!
Revision Changes Path
1.1 jbosstest/src/main/org/jboss/test/mdb/bean/TXTimeOutBean.java
Index: TXTimeOutBean.java
===================================================================
/*
* JBoss, the OpenSource J2EE webOS
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package org.jboss.test.mdb.bean;
import javax.ejb.MessageDrivenBean;
import javax.ejb.MessageDrivenContext;
import javax.ejb.EJBException;
import javax.jms.MessageListener;
import javax.jms.Message;
/**
* The TXTimeOutBean simulates when the onMessage() takes
* a long time to process the message. When this happens,
* the TM might time-out the transaction. This bean
* can be used to see if the TX times outs occur.
*
* @author Hiram Chirino
*/
public class TXTimeOutBean implements MessageDrivenBean, MessageListener{
long PROCESSING_DELAY = 10; // simulate 10 seconds of processing
public void setMessageDrivenContext(MessageDrivenContext ctx) {}
public void ejbCreate() {}
public void ejbRemove() {}
public void onMessage(Message message) {
try {
System.out.println("Simulating "+PROCESSING_DELAY+" second(s)
of message processing ");
Thread.sleep(PROCESSING_DELAY*1000);
System.out.println("Message processing simulation done.");
} catch (Throwable ignore) {}
}
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development