/** * Parse resources at the given location. Searches for a * PersistenceUnitInfo with the requested name, or an OpenJPA unit if * no name given (preferring an unnamed OpenJPA unit to a named one). */ private PersistenceUnitInfoImpl parseResources(ConfigurationParser parser, List<URL> urls, String name, ClassLoader loader) throws IOException { List<PersistenceUnitInfoImpl> pinfos = new ArrayList<PersistenceUnitInfoImpl>(); for (URL url : urls) { parser.parse(url); pinfos.addAll((List<PersistenceUnitInfoImpl>) parser.getResults()); } return findUnit(pinfos, name, loader); }
/** * Parse resources at the given location. Searches for a * PersistenceUnitInfo with the requested name, or an OpenJPA unit if * no name given (preferring an unnamed OpenJPA unit to a named one). */ private PersistenceUnitInfoImpl parseResources(ConfigurationParser parser, List<URL> urls, String name, ClassLoader loader) throws IOException { List<PersistenceUnitInfoImpl> pinfos = new ArrayList<PersistenceUnitInfoImpl>(); for (URL url : urls) { parser.parse(url); pinfos.addAll((List<PersistenceUnitInfoImpl>) parser.getResults()); } return findUnit(pinfos, name, loader); }
/** * Parse resources at the given location. Searches for a * PersistenceUnitInfo with the requested name, or an OpenJPA unit if * no name given (preferring an unnamed OpenJPA unit to a named one). */ private PersistenceUnitInfoImpl parseResources(ConfigurationParser parser, List<URL> urls, String name, ClassLoader loader) throws IOException { List<PersistenceUnitInfoImpl> pinfos = new ArrayList<PersistenceUnitInfoImpl>(); for (URL url : urls) { parser.parse(url); pinfos.addAll((List<PersistenceUnitInfoImpl>) parser.getResults()); } return findUnit(pinfos, name, loader); }
@Override public List getAnchorsInResource(String resource) throws Exception { ConfigurationParser parser = new ConfigurationParser(null); try { List results = new ArrayList(); ClassLoader loader = AccessController.doPrivileged( J2DoPrivHelper.getContextClassLoaderAction()); List<URL> urls = getResourceURLs(resource, loader); if (urls != null) { for (URL url : urls) { parser.parse(url); results.addAll(getUnitNames(parser)); } } return results; } catch (IOException e) { // not all configuration files are XML; return null if unparsable return null; } }
@Override public List getAnchorsInResource(String resource) throws Exception { ConfigurationParser parser = new ConfigurationParser(null); try { List results = new ArrayList(); ClassLoader loader = AccessController.doPrivileged( J2DoPrivHelper.getContextClassLoaderAction()); List<URL> urls = getResourceURLs(resource, loader); if (urls != null) { for (URL url : urls) { parser.parse(url); results.addAll(getUnitNames(parser)); } } return results; } catch (IOException e) { // not all configuration files are XML; return null if unparsable return null; } }
@Override public List getAnchorsInResource(String resource) throws Exception { ConfigurationParser parser = new ConfigurationParser(null); try { List results = new ArrayList(); ClassLoader loader = AccessController.doPrivileged( J2DoPrivHelper.getContextClassLoaderAction()); List<URL> urls = getResourceURLs(resource, loader); if (urls != null) { for (URL url : urls) { parser.parse(url); results.addAll(getUnitNames(parser)); } } return results; } catch (IOException e) { // not all configuration files are XML; return null if unparsable return null; } }
@Override public List getAnchorsInResource(String resource) throws Exception { ConfigurationParser parser = new ConfigurationParser(null); try { List results = new ArrayList(); ClassLoader loader = AccessController.doPrivileged( J2DoPrivHelper.getContextClassLoaderAction()); List<URL> urls = getResourceURLs(resource, loader); if (urls != null) { for (URL url : urls) { parser.parse(url); results.addAll(getUnitNames(parser)); } } return results; } catch (IOException e) { // not all configuration files are XML; return null if unparsable return null; } }
@Override public List getAnchorsInResource(String resource) throws Exception { ConfigurationParser parser = new ConfigurationParser(null); try { ClassLoader loader = (ClassLoader) AccessController.doPrivileged( J2DoPrivHelper.getContextClassLoaderAction()); List<URL> urls = getResourceURLs(resource, loader); if (urls != null) { for (URL url : urls) { parser.parse(url); } } return getUnitNames(parser); } catch (IOException e) { // not all configuration files are XML; return null if unparsable return null; } }
/** * Parse resources at the given location. Searches for a * PersistenceUnitInfo with the requested name, or an OpenJPA unit if * no name given (preferring an unnamed OpenJPA unit to a named one). */ private PersistenceUnitInfoImpl parseResources(ConfigurationParser parser, List<URL> urls, String name, ClassLoader loader) throws IOException { List<PersistenceUnitInfoImpl> pinfos = new ArrayList<PersistenceUnitInfoImpl>(); for (URL url : urls) { parser.parse(url); pinfos.addAll((List<PersistenceUnitInfoImpl>) parser.getResults()); } return findUnit(pinfos, name, loader); }
/** * Parse resources at the given location. Searches for a * PersistenceUnitInfo with the requested name, or an OpenJPA unit if * no name given (preferring an unnamed OpenJPA unit to a named one). */ private PersistenceUnitInfoImpl parseResources(ConfigurationParser parser, List<URL> urls, String name, ClassLoader loader) throws IOException { List<PersistenceUnitInfoImpl> pinfos = new ArrayList<PersistenceUnitInfoImpl>(); for (URL url : urls) { parser.parse(url); pinfos.addAll((List<PersistenceUnitInfoImpl>) parser.getResults()); } return findUnit(pinfos, name, loader); }
@Override public ConfigurationProvider load(File file, String anchor) throws IOException { if (!file.getName().endsWith(".xml")) return null; ConfigurationParser parser = new ConfigurationParser(null); parser.parse(file); return load(findUnit((List<PersistenceUnitInfoImpl>) parser.getResults(), anchor, null), null); }
@Override public List<String> getAnchorsInFile(File file) throws IOException { ConfigurationParser parser = new ConfigurationParser(null); try { parser.parse(file); return getUnitNames(parser); } catch (IOException e) { // not all configuration files are XML; return null if unparsable return null; } }
@Override public ConfigurationProvider load(File file, String anchor) throws IOException { if (!file.getName().endsWith(".xml")) return null; ConfigurationParser parser = new ConfigurationParser(null); parser.parse(file); return load(findUnit((List<PersistenceUnitInfoImpl>) parser.getResults(), anchor, null), null); }
@Override public ConfigurationProvider load(File file, String anchor) throws IOException { if (!file.getName().endsWith(".xml")) return null; ConfigurationParser parser = new ConfigurationParser(null); parser.parse(file); return load(findUnit((List<PersistenceUnitInfoImpl>) parser.getResults(), anchor, null), null); }
@Override public ConfigurationProvider load(File file, String anchor) throws IOException { if (!file.getName().endsWith(".xml")) return null; ConfigurationParser parser = new ConfigurationParser(null); parser.parse(file); return load(findUnit((List<PersistenceUnitInfoImpl>) parser.getResults(), anchor, null), null); }
@Override public List<String> getAnchorsInFile(File file) throws IOException { ConfigurationParser parser = new ConfigurationParser(null); try { parser.parse(file); return getUnitNames(parser); } catch (IOException e) { // not all configuration files are XML; return null if unparsable return null; } }
@Override public ConfigurationProvider load(File file, String anchor) throws IOException { if (!file.getName().endsWith(".xml")) return null; ConfigurationParser parser = new ConfigurationParser(null); parser.parse(file); return load(findUnit((List<PersistenceUnitInfoImpl>) parser.getResults(), anchor, null), null); }
@Override public List getAnchorsInFile(File file) throws IOException { ConfigurationParser parser = new ConfigurationParser(null); try { parser.parse(file); return getUnitNames(parser); } catch (IOException e) { // not all configuration files are XML; return null if unparsable return null; } }
@Override public List<String> getAnchorsInFile(File file) throws IOException { ConfigurationParser parser = new ConfigurationParser(null); try { parser.parse(file); return getUnitNames(parser); } catch (IOException e) { // not all configuration files are XML; return null if unparsable return null; } }
@Override public List<String> getAnchorsInFile(File file) throws IOException { ConfigurationParser parser = new ConfigurationParser(null); try { parser.parse(file); return getUnitNames(parser); } catch (IOException e) { // not all configuration files are XML; return null if unparsable return null; } }