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

[367 byte] By [hi_alla] at [2007-9-24]
# 1
U can use Thread.sleep(<time>);
gangireddya at 2007-7-16 > top of java,Enterprise & Remote Computing,Enterprise Technologies...
# 2

> 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

parsifala at 2007-7-16 > top of java,Enterprise & Remote Computing,Enterprise Technologies...
# 3
i searched for dtd files in sun's website but i could not find it can any one please give me the link?Is that ejb-jar.xml is comman irrespective of all the AS?Thanks in advance.
hi_alla at 2007-7-16 > top of java,Enterprise & Remote Computing,Enterprise Technologies...
# 4

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.

kcounsella at 2007-7-16 > top of java,Enterprise & Remote Computing,Enterprise Technologies...