{
final String message =
REZ.getString( "jmxmanager.error.mbean.load.class",
className );
getLogger().error( message, e );
throw new ManagerException( message, e );
}
// Create a new ModelMBean instance
ModelMBean mbean = null;
try
{
mbean = (ModelMBean)clazz.newInstance();
mbean.setModelMBeanInfo( topic );
}
catch( final Exception e )
{
final String message =
REZ.getString( "jmxmanager.error.mbean.instantiate",
className );
getLogger().error( message, e );
throw new ManagerException( message, e );
}
// Set the managed resource (if any)
try
{
if( null != target )
{
mbean.setManagedResource( target, "ObjectReference" );
}
}
catch( Exception e )
{
final String message =
REZ.getString( "jmxmanager.error.mbean.set.resource",
className );
getLogger().error( message, e );
throw new ManagerException( message, e );
}
return mbean;
}