Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

return, then instantiate?  RSS feed

Christopher Lombardi
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would like to create an EJB that uses a singleton pattern.
I have a slight twist on it however. The instantiation process
is terribly long, and I would not like the EJB clients to wait for the instantiation.
I would like the flow to go like this:
If the data is current, return the data.
If a refresh of data is in progress, return false.
If the data is expired, return false to the EJB client, and then kick off a refresh of the data.
The first two items are easy, the third, I cannot figure out how to do with the j2ee threading restriction.
Is there any way to do this?
Thanks much!

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!