From 9565419ee73c3581bd382f195fdf16c35a692f62 Mon Sep 17 00:00:00 2001 From: Lenny Primak Date: Mon, 5 Jul 2021 10:52:57 -0500 Subject: [PATCH] [FISH-5488] set fish.payara.tenantcontrol.blocking.disable system property default to true (#5325) --- .../nucleus/hazelcast/PayaraHazelcastTenantFactory.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nucleus/payara-modules/hazelcast-bootstrap/src/main/java/fish/payara/nucleus/hazelcast/PayaraHazelcastTenantFactory.java b/nucleus/payara-modules/hazelcast-bootstrap/src/main/java/fish/payara/nucleus/hazelcast/PayaraHazelcastTenantFactory.java index a14bde79bc3..7992bd8f345 100644 --- a/nucleus/payara-modules/hazelcast-bootstrap/src/main/java/fish/payara/nucleus/hazelcast/PayaraHazelcastTenantFactory.java +++ b/nucleus/payara-modules/hazelcast-bootstrap/src/main/java/fish/payara/nucleus/hazelcast/PayaraHazelcastTenantFactory.java @@ -41,6 +41,7 @@ import com.hazelcast.spi.tenantcontrol.TenantControl; import com.hazelcast.spi.tenantcontrol.TenantControlFactory; +import java.util.function.Supplier; import org.glassfish.api.invocation.ComponentInvocation; import org.glassfish.api.invocation.InvocationManager; import org.glassfish.internal.api.Globals; @@ -53,11 +54,13 @@ */ public class PayaraHazelcastTenantFactory implements TenantControlFactory { private static final String DISABLE_BLOCKING_PROPERTY = "fish.payara.tenantcontrol.blocking.disable"; + private static final Supplier getDisableBlockingProperty = + () -> Boolean.parseBoolean(System.getProperty(DISABLE_BLOCKING_PROPERTY, Boolean.TRUE.toString())); private final JavaEEContextUtil ctxUtil = Globals.getDefaultHabitat().getService(JavaEEContextUtil.class); private final InvocationManager invocationMgr = Globals.getDefaultHabitat().getService(InvocationManager.class); - static boolean blockingDisabled = Boolean.getBoolean(DISABLE_BLOCKING_PROPERTY); + static boolean blockingDisabled = getDisableBlockingProperty.get(); @Override public TenantControl saveCurrentTenant() { @@ -66,7 +69,7 @@ public TenantControl saveCurrentTenant() { if (invocation != null) { tenantControl = invocation.getRegistryFor(TenantControl.class); if (tenantControl == null && ctxUtil.isInvocationLoaded()) { - blockingDisabled = Boolean.getBoolean(DISABLE_BLOCKING_PROPERTY); + blockingDisabled = getDisableBlockingProperty.get(); tenantControl = new PayaraHazelcastTenant(); invocation.setRegistryFor(TenantControl.class, tenantControl); } else if (tenantControl == null) {