• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

CountDown class in JBoss sample?  RSS feed

 
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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...
 
He was giving me directions and I was powerless to resist. I cannot resist this tiny ad:
global solutions you can do at home or in your backyard
https://www.kickstarter.com/projects/paulwheaton/better-world-boo
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!