Results 1 to 2 of 2

Thread: How to unregister mbean

  1. #1
    Join Date
    Apr 2007
    Posts
    1

    Default How to unregister mbean

    I am registering a user session mbean with the MBeanExporter usging the following code at runtime:

    MBeanExporter mBeanExporter =
    (MBeanExporter) appContext.getBean("mBeanExporter");

    String objectName =
    "com.company.product:userSession=" + userSession.getId();
    mBeanExporter.registerManagedResource(userSessionM Bean,
    ObjectName.getInstance(objectName));

    When user session ends (user logs out), I'd like to unregister the the mbean, so that it disappears from the JMX console.

    Is there a way in Spring to unregister an mbean at runtime? Is the only way to unregister an mbean at runtime to get an explicit reference to MBeanServer?

  2. #2
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    I believe that is the only way. That's one of the uses of the *MBeanServerFactoryBean.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •