public Object instantiate(String className, ObjectName loaderName, Object[] args, String[] parameters)
throws ReflectionException, MBeanException, InstanceNotFoundException
{
if (className == null || className.trim().length() == 0)
{
throw new RuntimeOperationsException(new IllegalArgumentException("Class name cannot be null or empty"));
}
// loaderName can be null: means using this class' ClassLoader
loaderName = secureObjectName(loaderName);
if (loaderName != null && loaderName.isPattern())
{
throw new RuntimeOperationsException(new IllegalArgumentException("ObjectName for the ClassLoader cannot be a pattern ObjectName: " + loaderName));
}
ClassLoader cl = getClassLoaderImpl(loaderName);
return instantiateImpl(className, cl, null, parameters, args).mbean;
}