C H A P T E R 10 |
For 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 3.0 1/08 Foundation Services CMM Programming Guide.
A 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:
type | The possible types for this notification are listed below. |
source | The ObjectName of the node. |
The notification type is one of the following:
MASTER | The node is now the cluster master node. |
VICEMASTER | The node is now the cluster vice-master node. |
IN_CLUSTER | The node is now part of the cluster. |
OUT_OF_CLUSTER | The node is no longer part of the cluster. |
A 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:
source | The PmdStatisticsMBean ObjectName |
maxRetry | The maximum retry number that was exceeded |
The MAX_RETRIES field of this notification contains the name of the nametag that reached its maximum number of retries limit.
A javax.management.AttributeChangeNotification is sent by the PmdNameTagStatisticsMBean when either of the following conditions is true:
In addition to the standard notification information, this notification contains the following information:
type | ATTRIBUTE_CHANGE |
source | PmdNameTagStatisticsMBean |
attributeName | Either RetryCount if the retry counter has been reset, or MaxRetryCount if the maximum number of retries allowed has changed |
oldValue | The old number of retries allowed |
newValue | The new number of retries allowed |
The nametag field contains the name of the nametag that has been affected.
For 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 shows an implementation of the SnmpTrapListener class. SnmpTrapListener is a code snippet that registers the TrapListenerImpl class as a trap listener on trap port trapPort. The trap listener listens for SNMPv1, SNMPv2 and SNMPv3 traps. The TrapListenerImpl class prints the details of all the traps it receives to the standard output.
The following code snippet registers the TrapListenerImpl class as a trap listener on trap port trapPort.
Copyright © 2008, Sun Microsystems, Inc. All rights reserved.