Hi Paco!
My suggestion is to put the next code fragment into the method
wlshell.jmx.weblogic.queryMBeans(String server, String domain, String
type, String name)
(the additive lines are between comments) :
if(result != null && result.size() > 1 && parentValue !=
null)
{
String toMatch = "=" + parentValue;
TreeSet filtered = new TreeSet();
Iterator iter = result.iterator();
do
{
if(!iter.hasNext())
break;
ObjectName objectName = (ObjectName)iter.next();
if(objectName.toString().indexOf(toMatch) != -1)
filtered.add(objectName);
} while(true);
result = filtered;
}
//////// mod by ZsRezsek
if(result != null && result.size() > 1 && parentValue ==
null)
{
String toMatch = "Server=" + parentValue;
TreeSet filtered = new TreeSet();
Iterator iter = result.iterator();
do
{
if(!iter.hasNext())
break;
ObjectName objectName = (ObjectName)iter.next();
if(objectName.toString().indexOf(toMatch) == -1)
filtered.add(objectName);
} while(true);
result = filtered;
}
//////// mod by ZsRezsek
if(type == null)
{
TreeSet filteredResult = new TreeSet();
Iterator iter = result.iterator();
do
{
if(!iter.hasNext())
break;
ObjectName objectName = (ObjectName)iter.next();
String typeValue = objectName.getKeyProperty
("Type");
if(typeValue == null)
filteredResult.add(objectName);
} while(true);
result = filteredResult;
}
If several mbean types have different parent properties then you can
hardwire here with a case statement...
Please send me a compiled patch, because I could not recompile it
because of incorrect decompiling..
Thanx