spring-projects/spring-integration — pull request #942 by garyrussell (2013-10-30 20:19:30+00:00)
Title: INT-3186 Fix Metrics For Direct MessageHandler

When a simple MessageHandler is referenced from a
``, it is wrapped in an anonymous
AbstractReplyProducingMessageHandler to facilitate proper handling of
the `` and so that normal
'produced no reply` messages are logged.

Previously, this caused 2 MBeans to be exposed, one for tha actual
handler; one for the wrapper.

This added more stack frames between the dispatcher and the
handler (because 2 sets of statistics were captured).

The root cause was that the MBean exporter was not aware of the
relationship between these objects.

https://jira.springsource.org/browse/INT-3186

Add code to the IntegrationMBeanExporter to suppress adding
metrics to the wrapper.

This involves detecting that it is a wrapper and not exposing
it as an MBean and, when matching handlers with endpoints,
checking that the wrapped handler is the actual handler for the endpoint.

Update test to reflect the reduced number of stack frames between
the dispatcher and handler.

Also add tests to verify the detection of multiple references to
the same ARPMH.