{
String pkg = tokenizer.nextToken().trim();
RmiConnectorActivator.log(LogService.LOG_DEBUG,"Provider package: " + pkg, null);
// The spec states the package cannot be empty
if (pkg.length() == 0) throw new JMXProviderException("Empty package list not allowed: " + packages);
String providerClassName = constructClassName(pkg, protocol, className);
Class providerClass = null;
try
{
providerClass = loadClass(providerClassName, loader);
}
catch (ClassNotFoundException x)
{
RmiConnectorActivator.log(LogService.LOG_DEBUG,"Provider class " + providerClassName + " not found, continuing with next package",null);
continue;
}
catch (Exception x)
{
RmiConnectorActivator.log(LogService.LOG_WARNING,"Cannot load provider class " + providerClassName, x);
throw new JMXProviderException("Cannot load provider class " + providerClassName, x);
}
try
{
return providerClass.newInstance();
}
catch (Exception x)
{
RmiConnectorActivator.log(LogService.LOG_WARNING,"Cannot instantiate provider class " + providerClassName, x);
throw new JMXProviderException("Cannot instantiate provider class " + providerClassName, x);
}
}
// Nothing found
RmiConnectorActivator.log(LogService.LOG_DEBUG,"Could not find provider for protocol " + protocol + " in package list '" + packages + "'", null);