• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

spring : thread question

Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a question concerning on how to deal with threads...

Situation: a webbapplication (Struts-Spring). The business layer consists of spring beans and struts is used for the front-end handling.
The webApp is deployed on an application server (Weblogic), which takes care of all the threading issues if I'm not mistaken.

At one time in the application there is a call to a webservice, and since this may take a while I have created an 'in progress page' which keeps refreshing until the result has been retrieved.

I have created a spring bean which implements Runnable :

implementation of Runnable :

This is called from a Struts action as follows :

here's a fragment of the applicationContext :

This works fine but I don't like the following line

I've also heard that it is not proper to work with threads in a managed application server like weblogic.
So I think I might run into concurrency issues when many clients are calling the webservice.
And I'm not sure if it's proper to let a Spring bean implement Runnable ?

I've done some searching on the forum and somebody suggested to work with the ThreadPoolTaskExecutor, but Isn't this more related for 'tasks'.
And I don't think this is possible in a 1.4 JDK environment, is this
correct ?

Any information is welcome !



[ November 28, 2006: Message edited by: Kristof Camelbeke ]
[ November 28, 2006: Message edited by: Kristof Camelbeke ]
    Bookmark Topic Watch Topic
  • New Topic