JMX: Nick Stephen blogs on SnapshotProxies and SynchronizedStandardMBean

... Today Nick Stephen posted an article explaining how to access several attributes of one MBean in a synchronized way. This is a nice trick which can be quite useful.

Beware however that if you want to guarantee full data coherency, both the MBean implementation (server side) and the client application must cooperate (the client must use the described SnapshotProxy and not the regular proxy created by the MBeanServerInvocationHandler). If you use MXBeans however, data coherency is apparent right at the model level: the interface explicitely tells you that all the values are returned together, since they are part of the same attribute.

Yet, a SnapshotProxy may have other interesting properties: you could imagine coding a CachingSnapshotProxy that would refresh its internal cache of MBean attribute values only when it detects that its data is stale (because it received an AttributeValueChangeNotification from the remote MBean, or because the delay since the time it fetched the value has crossed a configured timeout). For instance, the JVM SNMP Agent, without directly using any such CachingSnapshotProxy, implements a somewhat similar mechanism to avoid calling the Management & Monitoring API too often...

Welcome to the World Of Sun Bloggers Nick!

Cheers
-- daniel
PS (not directly related to the subject of this blog): I have also updated my entry about Looking for JMX Overview, Examples, Tutorial, and more with a few additional links.
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Daniel Fuchs blogs on Scene Builder, JMX, SNMP, Java, etc...

The views expressed on this blog are those of the author and do not necessarily reflect the views of Oracle.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today