ObjectName objectName = getObjectName(notification);
assert(objectName != null);
if(objectName != null){
try{
//Get the in-memory representation of the notification.xml.
Notifications notifications = getNotifications();
if(notifications != null) {
//Get the domain of interest from the notification.xml
//Consider notifications only from this domain.
String domain = notifications.getDomain();
if(domain.equals(objectName.getDomain())){
com.sun.mfwk.agent.appserv.lifecycle.beans.ObjectName name = null;
//Return if notification is because of cascaded object.
//Plugin recieves two notifications for each monitoring object on the remote
//instance. One, when the monitoring object gets created on the remote server
//and the other when it gets cascaded to the DAS. This causes a problem when
//we have same Application or Module deployed to DAS and remote server.
//Cascaded object is overwriting the object instrumented by the remote server.
//To avoid this, plugin should not instrument CMM objects for cascaded AS mbeans.
if(!asInstance.equals(objectName.getKeyProperty(Constants.SERVER_NAME_KEY))) {
return false;
}
//for each of the <object-name> elements from notification.xml
for(int i=0; i<notifications.sizeObjectName(); i++){
name = notifications.getObjectName(i);
com.sun.mfwk.agent.appserv.lifecycle.beans.Attribute attribute = null;
String attributeName = null;
String attributeValue = null;
String value = null;
boolean ofInterest = true;