• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jmx and invoking its methods in jboss

 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic