in tx-control-providers/jpa/tx-control-provider-jpa-common/src/main/java/org/apache/aries/tx/control/jpa/common/impl/AbstractManagedJPAEMFLocator.java [74:97]
public AbstractManagedJPAEMFLocator(BundleContext context, String pid, Supplier<Map<String, Object>> jpaProperties,
Map<String, Object> providerProperties, Consumer<Map<String, Object>> onClose) throws InvalidSyntaxException, ConfigurationException {
this.context = context;
this.pid = pid;
this.jpaProperties = jpaProperties;
this.providerProperties = providerProperties;
this.onClose = onClose;
String unitName = (String) providerProperties.get(JPA_UNIT_NAME);
if (unitName == null) {
LOG.error("The configuration {} must specify a persistence unit name", pid);
throw new ConfigurationException(JPA_UNIT_NAME,
"The configuration must specify a persistence unit name");
}
String targetFilter = (String) providerProperties.get(EMF_BUILDER_TARGET_FILTER);
if (targetFilter == null) {
targetFilter = "(" + JPA_UNIT_NAME + "=" + unitName + ")";
}
targetFilter = "(&(" + OBJECTCLASS + "=" + EntityManagerFactoryBuilder.class.getName() + ")" + targetFilter + ")";
this.emfBuilderTracker = new ServiceTracker<>(context, context.createFilter(targetFilter), this);
}