Skip to content

Commit 8b6105e

Browse files
committed
Review updates
1 parent 1c6c205 commit 8b6105e

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

dev/io.openliberty.data.internal.persistence/src/io/openliberty/data/internal/persistence/DataProvider.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,13 @@ public class DataProvider implements //
212212
new ConcurrentHashMap<>();
213213

214214
/**
215-
* EntityManagerBuilder futures, grouped by application, for EJB modules
216-
* that are triggered to initialize on module starting rather than waiting
217-
* for application start.
215+
* EntityManagerBuilder futures, grouped by application, triggered to initialize
216+
* on module starting rather than waiting for application start.
218217
* The Set values in this map are subsets of the Set values in futureEMBuilders.
219218
* The entries are removed on application start, which uses the values to avoid
220219
* duplicated initalization attempts.
221220
*/
222-
private final ConcurrentHashMap<String, Set<FutureEMBuilder>> futureEMBuildersInEJB = //
221+
private final ConcurrentHashMap<String, Set<FutureEMBuilder>> processedFutureEMBuilders = //
223222
new ConcurrentHashMap<>();
224223

225224
/**
@@ -326,7 +325,7 @@ public void applicationStarted(ApplicationInfo appInfo) throws StateChangeExcept
326325
//Use deployment name but fall back to generated name
327326
String appName = appInfo.getDeploymentName() == null ? appInfo.getName() : appInfo.getDeploymentName();
328327
Set<FutureEMBuilder> futures = futureEMBuilders.get(appName);
329-
Set<FutureEMBuilder> skip = futureEMBuildersInEJB.remove(appName);
328+
Set<FutureEMBuilder> skip = processedFutureEMBuilders.remove(appName);
330329
if (futures != null) {
331330
for (FutureEMBuilder futureEMBuilder : futures) {
332331
if (skip == null || !skip.contains(futureEMBuilder))
@@ -881,13 +880,15 @@ public void moduleStarted(ModuleInfo moduleInfo) throws StateChangeException {
881880
public void moduleStarting(ModuleInfo moduleInfo) throws StateChangeException {
882881
final boolean trace = TraceComponent.isAnyTracingEnabled();
883882

884-
String appName = moduleInfo.getApplicationInfo().getDeploymentName();
883+
ApplicationInfo appInfo = moduleInfo.getApplicationInfo();
884+
//Use deployment name but fall back to generated name
885+
String appName = appInfo.getDeploymentName() == null ? appInfo.getName() : appInfo.getDeploymentName();
885886
String moduleName = moduleInfo.getName(); // does not include .jar at the end
886887

887888
if (trace && tc.isDebugEnabled())
888889
Tr.debug(this, tc, "moduleStarting " + moduleInfo, appName, moduleName);
889890

890-
Set<FutureEMBuilder> processed = futureEMBuildersInEJB.get(appName);
891+
Set<FutureEMBuilder> processed = processedFutureEMBuilders.get(appName);
891892

892893
// TODO it would be more direct to map from appName+moduleName -> FutureEMBuilder,
893894
// but we would need to take into account the difference in module names
@@ -902,7 +903,7 @@ public void moduleStarting(ModuleInfo moduleInfo) throws StateChangeException {
902903

903904
if (processed == null) {
904905
processed = new ConcurrentSkipListSet<>();
905-
Set<FutureEMBuilder> previous = futureEMBuildersInEJB //
906+
Set<FutureEMBuilder> previous = processedFutureEMBuilders //
906907
.putIfAbsent(appName, processed);
907908
if (previous != null)
908909
processed = previous;
@@ -911,6 +912,7 @@ public void moduleStarting(ModuleInfo moduleInfo) throws StateChangeException {
911912
processed.add(futureEMBuilder);
912913

913914
}
915+
914916
}
915917

916918
@Override

dev/io.openliberty.data.internal.persistence/src/io/openliberty/data/internal/persistence/cdi/FutureEMBuilder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -677,13 +677,13 @@ private J2EEName getArtifactName(Class<?> repositoryInterface,
677677
* Obtains the metadata identifier for the module that defines the repository
678678
* interface.
679679
*
680-
* @param webModule true for a Web Module, false for an EJB Module
680+
* @param isWebComponent true for a Web Module, false for an EJB Module
681681
*
682682
* @return metadata identifier as the key, and application/module/component
683683
* as the value. Module and component might be null or might not be
684684
* present at all.
685685
*/
686-
private String getMetadataIdentifier(boolean webModule) {
686+
private String getMetadataIdentifier(boolean isWebComponent) {
687687

688688
String mdIdentifier;
689689

@@ -693,7 +693,7 @@ private String getMetadataIdentifier(boolean webModule) {
693693
null);
694694
} else {
695695
mdIdentifier = provider.metadataIdSvc //
696-
.getMetaDataIdentifier(webModule ? "WEB" : "EJB",
696+
.getMetaDataIdentifier(isWebComponent ? "WEB" : "EJB",
697697
jeeName.getApplication(),
698698
jeeName.getModule(),
699699
null);

0 commit comments

Comments
 (0)