ObjectName resolvedName = input;
if ( input.isPattern() )
{
final Set<ObjectName> resolvedNames = JMXUtil.queryNames( getConn(), input, null );
final int numNames = resolvedNames.size();
if ( numNames == 1 )
{
resolvedName = GSetUtil.getSingleton( resolvedNames );
}
else if ( numNames > 1 )
{
throw new InstanceNotFoundException( input.toString() );
}
else
{
throw new InstanceNotFoundException( input.toString() );
}
}
return( resolvedName );