Help coderanch get a
new server
by contributing to the fundraiser
  • 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

Execute one 'application/service' at a time

Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a use case in which I would like to run one 'application/service' at a time.

In a simple example lets say I have a bunch of Services. Each one can be added to a queue. Queue will run one service until completion and then run the next. If the queue is empty it just hangs around until something is put on. Basically I would like to enforce single 'threading', ie I do not want two of these services running at the same time.

To make things a little more complicated I would like to run this in an app server (i.e. JBoss AS).

I know in Java I could probably do something like use a blockingqueue and pull one service off at a time. But I don't think it is a good idea to implement your own threading solution in an app server.

Any ideas?

He baked a muffin that stole my car! And this tiny ad:
We need your help - Coderanch server fundraiser
    Bookmark Topic Watch Topic
  • New Topic