1 22 23 package org.snmp4j.agent.mo.jmx; 24 25 import org.snmp4j.smi.OID; 26 import org.snmp4j.agent.mo.jmx.types.TypedAttribute; 27 import javax.management.openmbean.CompositeDataSupport ; 28 29 42 public class JMXAttributeNotificationIndexSupport 43 implements JMXNotificationIndexSupport 44 { 45 private TypedAttribute attribute; 46 private JMXIndexSupport indexSupport; 47 private OID index; 48 49 public JMXAttributeNotificationIndexSupport(TypedAttribute attribute, 50 JMXIndexSupport indexSupport) { 51 this.attribute = attribute; 52 this.indexSupport = indexSupport; 53 } 54 55 public void intialize(Object notificationUserObject) { 56 Object key = notificationUserObject; 57 if (notificationUserObject instanceof CompositeDataSupport ) { 58 key = ((CompositeDataSupport ) 59 notificationUserObject).get(attribute.getName()); 60 } 61 index = indexSupport.mapToIndex(key); 62 } 63 64 public OID getIndex(int objectIndex) { 65 return index; 66 } 67 } 68 | Popular Tags |