MBeans invoke operation
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Bandita_Pradhan
Posted On:   Thursday, September 4, 2008 01:56 PM

Hi , I have XML file below. <?xml version="1.0"?> xsi:noNamespaceSchemaLocation='collect_config.xsd'> com.hp.ov.nms.test:hook=ModelQuery StateString State Name CountNodeByStatus NORMAL java.lang.String CountIfaceByStatus WARNING java.lang.String I have following codes Loadconfig has following lines mbeanCollectors.add(new MBeanCollector(mbeanEntry.getMbeanName(), mbeanEntry.getAttributes(),mbeanEntry.getInvokeOps())); MBeanEntry class contains following code. public List getInvokeOps() { return invokeOps;    More>>

Hi ,

I have XML file below.

<?xml version="1.0"?>

xsi:noNamespaceSchemaLocation='collect_config.xsd'>

com.hp.ov.nms.test:hook=ModelQuery

StateString
State
Name



CountNodeByStatus


NORMAL
java.lang.String



CountIfaceByStatus

WARNING
java.lang.String







I have following codes

Loadconfig has following lines
mbeanCollectors.add(new MBeanCollector(mbeanEntry.getMbeanName(), mbeanEntry.getAttributes(),mbeanEntry.getInvokeOps()));

MBeanEntry class contains following code.

public List getInvokeOps() {
return invokeOps;
}

Then I have MBeanCollector class which contains following code

public MBeanCollector(String objectNameStr,
List stats, List ops)
throws MalformedObjectNameException, NullPointerException {
this.objectNameStr = objectNameStr;
objectName = new ObjectName(objectNameStr);
this.stats = new String[stats.size()];
stats.toArray(this.stats);
this.ops = new MBeanInvoke[ops.size()];
ops.toArray(this.ops);
}

public void collectStatsSet(PrintWriter writer, String[] stats, MBeanInvoke[] ops)
throws MBeanException, InstanceNotFoundException, ReflectionException, IOException {
AttributeList attributes = getMbsConnection().getAttributes(getObjectName(),
stats);

Object[] params = new Object[] { ops};

String[] signature = new String[] {String.class.getName()};

Object object = getMbsConnection().invoke(getObjectName(),"collectStatsSet", params, signature);


I am trying to do invoke opertion for the MBean Methods. But, I am confused and lost. Please help me.

Thanks,
Bandita    <<Less
About | Sitemap | Contact