This BZ is aimed at implementing part of https://issues.jboss.org/browse/PRODMGT-75 The issue with making availability return the result of the testConnection method is that this would be a heavy weight call (at least in comparison to the usual mbean, profile service checks) that will also use up a database connection every 30seconds, when the availability check is made. It would also return false, showing false down, if the avail check ran when all connections in the pool were in use, and the testConnection method failed. Instead we should investigate adding a trait, to the various JBAS related datasource resources types, that would be either true/false based on the result of testConnection. A description could be provided on the trait as to how the various scenarios mapped to true/false. This has the advantage over telling the user to create a scheduled operation to call the testConnection method that it could be enabled out of the box, requiring no user setup.
This is done for the as5 plugin: http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commitdiff;h=708c398 A new trait called "Connection Available?" has been added to all five of the datasource and connection factory ResourceTypes. The trait will have a value of "yes" or "no" depending on whether the call to testConnection() returned true or false. By default, the trait will be collected every 15 minutes. I'll clone this BZ, so we have a separate issue for the equivalent enhancement to the as7 plugin.
Installed EAP 5.1 server and verified that "Connection Available" trait is available (values *yes* and *no*) with the *Last Changed* column that reflects when this trait was last changed from one value to another.