• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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?

    Bookmark Topic Watch Topic
  • New Topic