EPackage.Registry.INSTANCE.put(JSF_LIBRARY_REGISTRY_NSURI, JSFLibraryRegistryPackageImpl.init());
URI jsfLibRegURI = JSFLibraryRegistryUpgradeUtil.getRegistryURI(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_LATESTVERSION_URL);
JSFLibraryRegistryUpgradeUtil.getInstance().upgradeRegistryIfNecessary(JSFLibraryRegistryUpgradeUtil.LATESTVERSION);
JSFLibraryRegistryResourceFactoryImpl resourceFactory = new JSFLibraryRegistryResourceFactoryImpl();
jsfLibraryRegistryResource = (JSFLibraryRegistryResourceImpl)resourceFactory.createResource(jsfLibRegURI);
try {
Map options = new HashMap();
//disable notifications during load to avoid changing stored default implementation
options.put(XMLResource.OPTION_DISABLE_NOTIFY, Boolean.TRUE);
jsfLibraryRegistryResource.load(options);
jsfLibraryRegistry = (JSFLibraryRegistry)jsfLibraryRegistryResource.getContents().get(0);
loadJSFLibraryExtensions();
loadDeprecatedJSFLibraryExtensions();//to be removed
} catch(IOException ioe) {
//Create a new Registry instance
jsfLibraryRegistry = JSFLibraryRegistryFactory.eINSTANCE.createJSFLibraryRegistry();
jsfLibraryRegistryResource = (JSFLibraryRegistryResourceImpl)resourceFactory.createResource(jsfLibRegURI);
jsfLibraryRegistryResource.getContents().add(jsfLibraryRegistry);
loadJSFLibraryExtensions();
loadDeprecatedJSFLibraryExtensions();//to be removed
saveJSFLibraryRegistry();
}