ObjectName resolvedName = input;
if ( input.isPattern() )
{
final Set resolvedNames = getConn().queryNames( input, null );
final int numNames = resolvedNames.size();
if ( numNames == 1 )
{
resolvedName = (ObjectName)resolvedNames.iterator().next();
}
else if ( numNames == 2 )
{
throw new InstanceNotFoundException( input.toString() );
}
else
{
throw new InstanceNotFoundException( input.toString() );
}
}
return( resolvedName );