• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

CountDown class in JBoss sample?

 
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying the samples mentioned in the JBoss Admin and Dev pdf file.
Chapter 6, Point-to-Point Example.
The sample code showed in the pdf file uses the foll. class :
EDU.oswego.cs.dl.util.concurrent.CountDown;
Can somebody tell me, what is this class and is it shipped along with JBoss?
import EDU.oswego.cs.dl.util.concurrent.CountDown;
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To my surprise, I didn't get any compile time errors while compiling the class!.....So I searched for the class and found it! It is present in the jbossall-client.jar.
Looks like the class Countdown has 2 primary methods.
acquire() : obtains a lock on the "this" object and goes into a wait() state.
release() : calls notify.
I think the sample uses it to wait forever, till it gets a message from the queue.
thanks,
Vish
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An Observation:
Most of the samples in the Chapter 6, Messaging on JBoss - JMS Configuration and Architecture
of the same guide.
seem to have the foll. statement:
System.exit(0);
at the end for the main method in the class.
I think this may be a redundant statement, as without this also, the program is executing gracefully...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic