Skip to content

Commit

Permalink
[FISH-5488] set fish.payara.tenantcontrol.blocking.disable system pro…
Browse files Browse the repository at this point in the history
…perty default to true (payara#5325)
  • Loading branch information
lprimak authored and Pandrex247 committed Apr 25, 2023
1 parent b2893d7 commit 9565419
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<Boolean> 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() {
Expand All @@ -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) {
Expand Down

0 comments on commit 9565419

Please sign in to comment.