it's crazy how such a trivial change can be more complex than envisioned.
If I want to cache the client session for the duration of the management object life, I
also need to close it cleanly at the end of its life.
I can't do that from JMX (the method is not exposed from the mbean) so I need to keep
a registry of these objects in the ManagementServiceImpl so that I can close their client
session properly when unregistering the resource.
I agree that the code as it is is a performance killer. But what kind of performance are
we talking about? This code will be called every time a mbean operation is invoked which
means that there will be a network trip between the JMX client and the server every time.
This seems to me like premature optimization. In that specific case, I'd prefer to
trade performance for code simplicity (i.e. create the client session for every
invocation).
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4211125#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...