Announcement Announcement Module
No announcement yet.
MBeanExporter and DataSource Opening Connections? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • MBeanExporter and DataSource Opening Connections?


    I'm trying out the MBeanExporter to expose our DBCP pool. This works great to expose it as an MBean, and I can easily see it in jconsole.

    What seems odd is that every time I refresh (via the GUI) the number of active connections goes up by 2. I have done enough experimenting to be sure that it is not the result of some external usage. I am sure that by refreshing the mbean attributes, I am opening two connections and leaving them open.

    I'm imagining that by refreshing, it is running through all getters, and thus calling getConnection().

    Is there a way to selectively hide getters from a bean, so that they are not exposed by mbean attributes? That is, short of creating a read only interface for DataSource.


  • #2
    OK, sorry about that. I spoke way too soon.

    On further investigation, I found the lovely MethodNameBasedMBeanInfoAssembler. Bingo, just what I need.

    Thanks, and sorry for the noise.


    • #3
      Just for some closure on this topic, I submitted a new MBeanInfoAssembler implementation. This acts as the opposite of MethodNameBasedMBeanInfoAssembler, in that it provides a list of method names to ignore. All others are included.