public static final QName NAME_Q
= new QName(XMLConfigConstants.NULL_NAMESPACE, "name");
public static Registry createRegistry(OMElement elem, Properties properties) {
OMAttribute prov = elem.getAttribute(PROVIDER_Q);
if (prov != null) {
try {
Class provider = Class.forName(prov.getAttributeValue());
Registry registry = (Registry) provider.newInstance();
registry.init(getProperties(elem, properties));
return registry;
} catch (ClassNotFoundException e) {
handleException("Cannot locate registry provider class : " +
prov.getAttributeValue(), e);
} catch (IllegalAccessException e) {
handleException("Error instantiating registry provider : " +
prov.getAttributeValue(), e);
} catch (InstantiationException e) {
handleException("Error instantiating registry provider : " +
prov.getAttributeValue(), e);
}
} else {
handleException("The registry 'provider' " +
"attribute is required for a registry definition");
}