*/
public Map findAssociatedMBeans(ObjectName mbeanObjectName, String relationTypeName, String roleName) throws
IllegalArgumentException
{
if (mbeanObjectName == null) throw new IllegalArgumentException("mbean ObjectName cannot be null.");
Logger logger = getLogger();
if (logger.isEnabledFor(Logger.DEBUG))
logger.debug("finding associated relations for MBean with ObjectName: "
+ mbeanObjectName.getCanonicalName() + " and relationTypeName: " + relationTypeName + " and roleName: " + roleName);
Map relationIdsToRoleNames = findReferencingRelations(mbeanObjectName, relationTypeName, roleName);
Map result = new HashMap();
for (Iterator i = (relationIdsToRoleNames.keySet()).iterator(); i.hasNext();)
{
String currentRelationId = (String)i.next();
HashMap objectNamesToRoleMap;
try
{
objectNamesToRoleMap = (HashMap)(getReferencedMBeans(currentRelationId));
}
catch (RelationNotFoundException ex)
{
logger.warn("Relation with ID: " + currentRelationId + " not found.");
throw new RuntimeOperationsException(null, "Relation Not Found");
}
for (Iterator iter = (objectNamesToRoleMap.keySet()).iterator(); iter.hasNext();)
{
ObjectName objectName = (ObjectName)iter.next();