}
}
public static ObjectName getObjectName( Object o ) throws NotCompliantMBeanException
{
MBean mb = o.getClass().getAnnotation( MBean.class );
if( mb != null )
{
try
{
return new ObjectName( mb.name() );
}
catch( Exception e ) {}
}
throw new NotCompliantMBeanException("Object must be annotated with @MBean and have a proper name attribute");