![]() |
|||
![]() |
![]() ![]() |
![]() |
![]() ![]() |
![]() |
![]() ![]() |
![]() |
| ||||||||||||||||||||||||||||
Chapter 10Receiving NotificationsThis chapter explains the NMA notification mechanism and describes the NMA notifications in detail. This chapter contains the following sections: Registering to Receive NotificationsFor information and instructions about writing and registering a notification listener, see the Java Dynamic Management Kit 5.0 Tutorial. Note that this information applies to the NMA only and is separate from the process of registering for notifications sent by the CMM. For information on these, see "Receiving and Handling Change Notifications" in the Netra High Availability Suite Foundation Services 2.1 6/03 CMM Programming Guide. NhasCmmNotificationA NhasCmmNotification notification is sent by the ClusterNodeMBean when a node leaves or joins the cluster, or when a failover or switchover occurs. In addition to the standard notification information, this notification contains the following information:
The notification type is one of the following:
NhasPmdMaxRetriesNotificationA NhasPmdMaxRetriesNotification notification is sent by the PmdStatisticsMBean when the maximum number of retries has been reached for a nametag. In addition to the standard notification information, this notification contains the following information:
The MAX_RETRIES field of this notification contains the name of the nametag that reached its maximum number of retries limit. NhasPmdAttributeChangeNotificationA javax.management.AttributeChangeNotification is sent by the PmdNameTagStatisticsMBean when either of the following conditions is true:
The nametag field contains the name of the nametag that has been affected. NhasPmdNewNameTagNotificationA NhasPmdNewNameTagNotification is sent whenever the Daemon Monitor creates a new nametag. This notification contains the field NEW_NAMETAG which contains the name of the new nametag. NhasPmdRemoveNameTagNotificationA NhasPmdRemoveNameTagNotification is sent whenever the Daemon Monitor removes a nametag from the collection. This notification contains the field REMOVE_NAMETAG which contains the name of the nametag that was removed. Registering to Receive SNMP TrapsFor a Java DMK SNMP manager to receive SNMP traps, an implementation of the SnmpTrapListener class must be registered on the SNMP trap port. Example 10-1 is an implementation of the SnmpTrapListener that listens for SNMPv1, SNMPv2 and SNMPv3 traps. Example 10-2 is a code snippet that registers the TrapListenerImpl class as a trap listener on trap port trapPort. The TrapListenerImpl class prints the details of all the traps it receives to the standard output. Example 10-1 Implementation of the SnmpTrapListener Class
The following code snippet registers the TrapListenerImpl class as a trap listener on trap port trapPort. Example 10-2 Registering a Trap Listener
| ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
![]() |