I was wondering if anyone had made an attempt to create an asynchrounous object within EJB. We are trying to port our terminal emulation software to a web based product and we are planning to use EJB. Not sure if this a good idea. The protocol to our legacy host does not follow a request-response model. It can receive multiple responses per request as well as unsolicited responses. Our existing communication object (uses sockets) is asynchronous (creates threads) and we cannot port that to EJB since EJB does not allow us to create threads. Is there a way or workaround to this problem? We cannot block on othe socket calls and I dont like the idea of polling. Any suggestions/ideas will be appreciated.
Thanks
Devaraj
-
asynchronous session objects (long) (4 messages)
- Posted by: devaraj sundaram
- Posted on: July 10 2000 11:55 EDT
Threaded Messages (4)
- asynchronous session objects (long) by Damian Guy on July 10 2000 20:56 EDT
- asynchronous session objects (long) by Gene Florintsev on July 12 2000 19:41 EDT
- asynchronous session objects (long) by David Kempster on July 18 2000 16:05 EDT
- asynchronous session objects (Another Question) by Driss Zouak on August 16 2000 16:38 EDT
-
asynchronous session objects (long)[ Go to top ]
- Posted by: Damian Guy
- Posted on: July 10 2000 20:56 EDT
- in response to devaraj sundaram
I think the answer to your problem is JMS. I am pretty sure that JMS allows you to do asynchronous messaging. -
asynchronous session objects (long)[ Go to top ]
- Posted by: Gene Florintsev
- Posted on: July 12 2000 19:41 EDT
- in response to devaraj sundaram
Note that in EJB 2.0 (which is now has beta support in WebLogic 5.1) there are message-driven beans. This is a new kind of bean, associated with a JMS topic (yes, JMS support is mandated by the EJB 2.0 spec). The message-driven bean is activated when a message arrives. The middleware takes care of activation.
This could be the right architecture for you, if you can wait for commercial release of this stuff (as far as I understand, in the fall timeframe).
Gene Florintsev
gene at ejbility dot com
-
asynchronous session objects (long)[ Go to top ]
- Posted by: David Kempster
- Posted on: July 18 2000 16:05 EDT
- in response to devaraj sundaram
The fact that you get back multiple responses to a request and that you you get unsolisted responses doesn't really mean you have broken the request response architecture. We had a full request response server (in C++) that had both of these features. Use a composite pattern for both requests and responses and you can get around this.
The multi - threading issue: the point of ejb is that the container manages the threads and not the objects themselves. So it is not really true that EJB's are not able to be used in a multiple threaded environment it is just that you don't have as much control. I created a class that spons 500 threads that call the "same" ejb and it works fine. If they are session beans the app server will spawn new instances to service your request.
I am not sure if I have understood your question the way you intended but I hope that helps -
asynchronous session objects (Another Question)[ Go to top ]
- Posted by: Driss Zouak
- Posted on: August 16 2000 16:38 EDT
- in response to David Kempster
I have a similar issue, and haven't seen a solution to it
in the discussion.
Q: I need "something" (avoiding saying threads) on my server side to be monitoring modems for inbound calls.
Each modem can have different logic that should be used
when the call comes in.
To my knowledge there is no way of handling this in EJB
or EJB 2. The messaging solution doesn't seem to work
because nothing is listening to the inbound call.
Normally the modems are used for outbound calls which
are triggered from user events.
thanks,
Driss.