• Post Reply Bookmark Topic Watch Topic
  • New Topic

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...
 
Crusading Chameleon likes the size of this ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!