Sridhar
Sridhar

Reputation:

How to set a timeout during remote ejb lookup?

I'm trying to access a remote ejb which is not available yet. But the lookup takes 5 min before I get the NameNotFoundException. Is there a way I can set the lookup timeout to a lesser value so that the client application doesn't hang for 5 mins? Thanks in advance...

Upvotes: 3

Views: 2702

Answers (1)

Swapnonil Mukherjee
Swapnonil Mukherjee

Reputation: 2342

Do the lookup in another thread, so that the client GUI does not hang. You can use plain Runnable to do this, or try a better option like swingworker.

To customize the JNDI lookup timeout, I am afraid, you will have to hack the internals of an open source app server, if that is an option.

Upvotes: 2

Related Questions