• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jmx and invoking its methods in jboss

 
Preetham Chandrasekhar
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have implemented an mbean which has 2 simple methods...start() and stop()...
The start() method instantiates a singleton class which holds on to sessions as a hash...and the stop() method nullifies this singleton...

When I start the server...things seem to be working fine...the singleton class is instantiated and am able to store the sessions etc...which is good...but if I try invoking the stop()/start() methods from the jmx-console of the jboss...though it prints out the debug statements I have in there...the methods dont seem to work - when I invoke them from the jmx-console...

for ex: If I invoke the stop() method...it doesnt seem to nullify the singleton instance...

I am a beginner to jmx...so hope I made my question clear...

I am using jboss4.2 as my AS...

Thanks
Preetham
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but if I try invoking the stop()/start() methods from the jmx-console of the jboss...though it prints out the debug statements I have in there...the methods dont seem to work - when I invoke them from the jmx-console...

for ex: If I invoke the stop() method...it doesnt seem to nullify the singleton instance...


Does the control enter the stop method? You can check this by adding System.out.println statements in that method. And if it does enter this method, then the invoking the stop method from jmx-console is working.

When you say the nullify of singleton instance does not work, how did you test it? Are you sure the instance is not getting created again after you have set the instance to null. Also, can you post the code of this MBean where you are doing these operations?
 
Shenaz Assu
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Preetham,

I tried your scenario in my system and its working for me. As Jaikiran said, maybe you should post the code. Then we may able to help you.

Cheers
Shenaz
 
Preetham Chandrasekhar
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the initiative guys...I fixed the issue...the singleton class contains a hash of sessions...I was just nullifying the singleton class...but later I first nullified the hash and then made the singleton class as null...and its working fine now...weird...but I guess thats how it is...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic