This week's book giveaway is in the General Computing forum.
We're giving away four copies of Learning Regular Expressions and have Ben Forta on-line!
See this thread for details.
Win a copy of Learning Regular Expressions this week in the General Computing forum!
  • 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • 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...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!