MDB PLEASE HELP
HI
in my mdb's on message ie
onMessage(Message msg){
amethod()//whiich might block for ever
}
I want to tell MDB, wait for cetain time and then discard this and process next one
how i can tell this (i am using JBoss as AS
please help
HI
in my mdb's on message ie
onMessage(Message msg){
amethod()//whiich might block for ever
}
I want to tell MDB, wait for cetain time and then discard this and process next one
how i can tell this (i am using JBoss as AS
please help
> U can use Thread.sleep(<time>);
use of Thread concepts in EJB is discouraged. That would interefere with the App server's processes.
Check the ejb-jar.xml. There might be some tag to enable the onMessage method to wait for some time. For some reasons i m unable to download the dtd of ejb-jar.xml from sun's website.
regards
The ejb-jar.xml is the same for all application servers, but you typically need an additional deployment descriptor that is specific to the AS, such as jboss.xml for JBoss.
The schema for EJB 2.1 is at http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd, and the DTD for EJB 2.0 is at http://java.sun.com/dtd/ejb-jar_2_0.dtd.
If there is no built-in support for what you want to do, and if the blocking call is in some way interruptable, you could schedule a callback with the EJB timer service. Of course, you would have to store a reference to the running task somewhere so that when the timer goes off you can find and interrupt it.