From d44b6e21e5bc13ac8c26f78be24c997bc75b9454 Mon Sep 17 00:00:00 2001 From: lprimak Date: Fri, 2 Jul 2021 00:35:41 -0500 Subject: [PATCH] [FISH-5488] set fish.payara.tenantcontrol.blocking.disable system property default to true --- .../nucleus/hazelcast/PayaraHazelcastTenantFactory.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 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 1229aef56a5..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 @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) [2016-2020] Payara Foundation and/or its affiliates. All rights reserved. + * Copyright (c) [2016-2021] Payara Foundation and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -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) {