It's not a secret anymore!*
The moose likes EJB and other Java EE Technologies and the fly likes [urgent] need help on interceptor and suspending threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "[urgent] need help on interceptor and suspending threads" Watch "[urgent] need help on interceptor and suspending threads" New topic
Author

[urgent] need help on interceptor and suspending threads

Mohamad Norouzi
Greenhorn

Joined: Oct 12, 2004
Posts: 18
Hi friends,

We are using EJB3 and we've created an interceptor to check whether the user has already sent a request or not.
if we noticed that the user has already sent a request then in this interceptor we need to suspend that thread and wait till the former request being completed otherwise the thread will proceed.

in order to find whether or not a user has sent a request, each time a request comes, we store its user id in a Map structure.

here is the body of our interceptor



now, I am skeptical on the way this works. I just created this interceptor based on information gathering through the internet and not sure that works fine. Unfortunately, I can't create a situation in which we can test the system.

I have seen a CountDownLatch but I fear to use that because no knowledge I have about that.

I appreciate if you can help me on this

thank you very much
[ August 26, 2008: Message edited by: mnrz ]

<a href="http://pixelshot.wordpress.com" target="_blank" rel="nofollow">http://pixelshot.wordpress.com</a><br /><a href="http://brainable.blogspot.com" target="_blank" rel="nofollow">http://brainable.blogspot.com</a>
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: [urgent] need help on interceptor and suspending threads
 
Similar Threads
[Urgent] need help on Lock and Condition
Entity Bean unavailable to me
Android CustomListView getView() getting nullpointerexception
Unable to update database
issues in calling the ejbcontroller (EJB 3.o ) from the controller using spring Frame