private String findResourceId(final String resourceId, final String type, final Properties required, final AppResources appResources) { if (resourceId == null) { return null; } return findResourceId(getResourceIds(appResources, type, required), resourceId); }
private String findResourceId(final String resourceId, final String type, final Properties required, final AppResources appResources) { if (resourceId == null) { return null; } return findResourceId(getResourceIds(appResources, type, required), resourceId); }
private void checkUnitDataSourceRefs(PersistenceUnit unit) throws OpenEJBException { Properties required = new Properties(); // check that non-jta-data-source does NOT point to a JtaManaged=true datasource required.put("JtaManaged", "true"); String invalidNonJta = findResourceId(unit.getNonJtaDataSource(), "DataSource", required, null); if (invalidNonJta != null){ throw new OpenEJBException("PeristenceUnit "+unit.getName()+" <non-jta-data-source> points to a jta managed Resource. Update Resource \""+invalidNonJta +"\" to \"JtaManaged=false\", use a different Resource, or delete the <non-jta-data-source> element and a default will be supplied if possible."); } // check that jta-data-source does NOT point to a JtaManaged=false datasource required.put("JtaManaged", "false"); String invalidJta = findResourceId(unit.getJtaDataSource(), "DataSource", required, null); if (invalidJta != null){ throw new OpenEJBException("PeristenceUnit "+unit.getName()+" <jta-data-source> points to a non jta managed Resource. Update Resource \""+invalidJta +"\" to \"JtaManaged=true\", use a different Resource, or delete the <jta-data-source> element and a default will be supplied if possible."); } }
private void checkUnitDataSourceRefs(final PersistenceUnit unit) throws OpenEJBException { final Properties required = new Properties(); // check that non-jta-data-source does NOT point to a JtaManaged=true datasource required.put("JtaManaged", "true"); final String invalidNonJta = findResourceId(unit.getNonJtaDataSource(), "DataSource", required, null); if (invalidNonJta != null) { throw new OpenEJBException("PeristenceUnit " + unit.getName() + " <non-jta-data-source> points to a jta managed Resource. Update Resource \"" + invalidNonJta + "\" to \"JtaManaged=false\", use a different Resource, or delete the <non-jta-data-source> element and a default will be supplied if possible."); } // check that jta-data-source does NOT point to a JtaManaged=false datasource required.put("JtaManaged", "false"); final String invalidJta = findResourceId(unit.getJtaDataSource(), "DataSource", required, null); if (invalidJta != null) { throw new OpenEJBException("PeristenceUnit " + unit.getName() + " <jta-data-source> points to a non jta managed Resource. Update Resource \"" + invalidJta + "\" to \"JtaManaged=true\", use a different Resource, or delete the <jta-data-source> element and a default will be supplied if possible."); } }
private void checkUnitDataSourceRefs(final PersistenceUnit unit) throws OpenEJBException { final Properties required = new Properties(); // check that non-jta-data-source does NOT point to a JtaManaged=true datasource required.put("JtaManaged", "true"); final String invalidNonJta = findResourceId(unit.getNonJtaDataSource(), "DataSource", required, null); if (invalidNonJta != null) { throw new OpenEJBException("PeristenceUnit " + unit.getName() + " <non-jta-data-source> points to a jta managed Resource. Update Resource \"" + invalidNonJta + "\" to \"JtaManaged=false\", use a different Resource, or delete the <non-jta-data-source> element and a default will be supplied if possible."); } // check that jta-data-source does NOT point to a JtaManaged=false datasource required.put("JtaManaged", "false"); final String invalidJta = findResourceId(unit.getJtaDataSource(), "DataSource", required, null); if (invalidJta != null) { throw new OpenEJBException("PeristenceUnit " + unit.getName() + " <jta-data-source> points to a non jta managed Resource. Update Resource \"" + invalidJta + "\" to \"JtaManaged=true\", use a different Resource, or delete the <jta-data-source> element and a default will be supplied if possible."); } }
String id = findResourceId(beanName + '/' + resourceId, type, required, appResources); // check first in app namespace if (id != null) { return id; id = findResourceId(resourceId, type, required, appResources); if (id != null) { return id; id = findResourceId(resourceId, null, required, appResources); if (id != null) { return id; id = findResourceId(resourceId.substring(appResources.appId.length() + 1), type, required, appResources); if (id != null) { return id;
final String id = AutoConfig.findResourceId(ids, dataSourceName);
String id = findResourceId(beanName + '/' + resourceId, type, required, appResources); // check first in app namespace if (id != null) { return id; id = findResourceId(resourceId, type, required, appResources); if (id != null) { return id; id = findResourceId(resourceId, null, required, appResources); if (id != null) { return id;
String id = findResourceId(resourceId, type, required, appResources); if (id != null) return id; id = findResourceId(resourceId, null, required, appResources); if (id != null) return id;
final AppModule appModule = ejbModule.getAppModule(); if (appModule != null) { final String newId = findResourceId(appModule.getModuleId() + '/' + id.replace("java:", "").replaceAll("^comp/env/", ""), refType, new Properties(),
final AppModule appModule = ejbModule.getAppModule(); if (appModule != null) { final String newId = findResourceId(appModule.getModuleId() + '/' + id.replace("java:", "").replaceAll("^comp/env/", ""), refType, new Properties(),
String jtaDataSourceId = findResourceId(unit.getJtaDataSource(), "DataSource", required, null); String nonJtaDataSourceId = findResourceId(unit.getNonJtaDataSource(), "DataSource", required, null); required.put("JtaManaged", NONE); jtaDataSourceId = findResourceId(unit.getJtaDataSource(), "DataSource", required, null); nonJtaDataSourceId = findResourceId(unit.getNonJtaDataSource(), "DataSource", required, null); String possibleJta = findResourceId(unit.getJtaDataSource(), "DataSource", required, null); String possibleNonJta = findResourceId(unit.getNonJtaDataSource(), "DataSource", required, null); if (possibleJta != null && possibleJta == possibleNonJta){ ResourceInfo dataSource = configFactory.getResourceInfo(possibleJta); jtaDataSourceId = findResourceId(id, "DataSource", required, null); nonJtaDataSourceId = findResourceId(id, "DataSource", required, null); jtaDataSourceId = findResourceId(id, "DataSource", required, null);
jtaDataSourceId = findResourceId(prefix + jtaWithJavaAndSlash, "DataSource", required, null); if (jtaDataSourceId == null) { // test with javax.sql.DataSource before DataSource since RA can register resources without our shortcut jtaDataSourceId = findResourceId(jtaWithJavaAndSlash, "javax.sql.DataSource", required, null); nonJtaDataSourceId = findResourceId(prefix + nonJtaWithJavaAndSlash, "DataSource", required, null); if (nonJtaDataSourceId == null) { nonJtaDataSourceId = findResourceId(nonJtaWithJavaAndSlash, "DataSource", required, null); jtaDataSourceId = findResourceId(unit.getJtaDataSource(), "DataSource", required, null); nonJtaDataSourceId = findResourceId(unit.getNonJtaDataSource(), "DataSource", required, null); final String possibleJta = findResourceId(jtaWithJavaAndSlash, "DataSource", required, null); final String possibleNonJta = findResourceId(nonJtaWithJavaAndSlash, "DataSource", required, null); if (possibleJta != null && possibleJta.equals(possibleNonJta)) { final ResourceInfo dataSource = configFactory.getResourceInfo(possibleJta); jtaDataSourceId = findResourceId(id, "DataSource", required, null); nonJtaDataSourceId = findResourceId(id, "DataSource", required, null); jtaDataSourceId = findResourceId(id, "DataSource", required, null);
jtaDataSourceId = findResourceId(prefix + jtaWithJavaAndSlash, "DataSource", required, null); if (jtaDataSourceId == null) { // test with javax.sql.DataSource before DataSource since RA can register resources without our shortcut jtaDataSourceId = findResourceId(jtaWithJavaAndSlash, "javax.sql.DataSource", required, null); nonJtaDataSourceId = findResourceId(prefix + nonJtaWithJavaAndSlash, "DataSource", required, null); if (nonJtaDataSourceId == null) { nonJtaDataSourceId = findResourceId(nonJtaWithJavaAndSlash, "DataSource", required, null); jtaDataSourceId = findResourceId(unit.getJtaDataSource(), "DataSource", required, null); nonJtaDataSourceId = findResourceId(unit.getNonJtaDataSource(), "DataSource", required, null); final String possibleJta = findResourceId(jtaWithJavaAndSlash, "DataSource", required, null); final String possibleNonJta = findResourceId(nonJtaWithJavaAndSlash, "DataSource", required, null); if (possibleJta != null && possibleJta.equals(possibleNonJta)) { final ResourceInfo dataSource = configFactory.getResourceInfo(possibleJta); jtaDataSourceId = findResourceId(id, "DataSource", required, null); nonJtaDataSourceId = findResourceId(id, "DataSource", required, null); jtaDataSourceId = findResourceId(id, "DataSource", required, null);