This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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...
 
I AM MIGHTY! Especially when I hold this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!