Hi!
Sacha Labourey wrote:
> Imagine the case where I want to call an EJB (statefull session or entity
> for example) to tell him to perform some action, let's say to download a
> file for example.
>
> What I would like is that the EJB gives back the hand directly to the client
> (i.e. the method call returns) but continues to perform its lenghty process
> in the background. When finished, it calls back the client (through a
> reference given during the first method call) and tell him the download is
> finished.
>
> This does not seem to fit in the EJB concept. Am I wrong?
>
> How to implement these call-back and server background processing with the
> EJB?
Well, since you mentioned the magic words "the method call returns" you
will at least know you want to use JMS, i.e. MessageDriven Beans. Your
first EJB will send a message to a queue, with the work to be processed.
An MDB can then process whatever that is.
Then you have (at least) two options:
1) You can embed an RMI callback object in the message which the
processing bean can use to call the client. If the client has crashed
you're in trouble, but that's something you will simply have to account
for
2) Have the processing bean send another message to another queue, and
have the client listen to that queue.
Both should work.
/Rickard
--
Rickard Öberg
Email: [EMAIL PROTECTED]
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]