factoryClass = Class.forName(factoryClassName);
// try to instantiate and cast the factory as an additional check
QueueConnectionFactory factory = (QueueConnectionFactory) factoryClass.newInstance();
// fake check to make factory var used
if (factory == null)
throw new ProviderConfigurationException(name, "factory class instance is null");
}
catch (ClassNotFoundException ex) {
throw new ProviderConfigurationException(name, "factory class not found", ex);
}
catch (InstantiationException ex) {
throw new ProviderConfigurationException(name, "factory cannot be created", ex);
}
catch (IllegalAccessException ex) {
throw new ProviderConfigurationException(name, "factory is not accessible", ex);
}
}