Skip to content

Commit

Permalink
Merge pull request #6006 from luiseufrasio/FISH-6495-Payara6
Browse files Browse the repository at this point in the history
FISH-6495 : setting hazelcast property when passed
  • Loading branch information
luiseufrasio authored Nov 1, 2022
2 parents df927b1 + 25e046c commit 5046d41
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2009-2012 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009-2022 Oracle 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
Expand Down Expand Up @@ -93,6 +93,10 @@ public static GlassFishRuntime bootstrap() throws GlassFishException {
* @throws GlassFishException
*/
public static GlassFishRuntime bootstrap(BootstrapProperties bootstrapProperties) throws GlassFishException {
String hazelcastProperty = bootstrapProperties.getProperty("hazelcast.config");
if (hazelcastProperty != null) {
System.setProperty("hazelcast.config", hazelcastProperty);
}
return bootstrap(bootstrapProperties, GlassFishRuntime.class.getClassLoader());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,16 +308,11 @@ public void setEnabled(Boolean enabled) {
private Config buildConfiguration() {
Config config = new Config();
String hazelcastFilePath = "";
URL serverConfigURL;
try {
serverConfigURL = new URL(context.getServerConfigURL());
Boolean isChangeToDefault = Boolean.valueOf(configuration.getChangeToDefault());
File serverConfigFile = new File(serverConfigURL.getPath());
if (new File(configuration.getHazelcastConfigurationFile()).exists()) {
hazelcastFilePath = System.getProperty("hazelcast.config");
if (hazelcastFilePath == null || hazelcastFilePath.isEmpty()) {
hazelcastFilePath = configuration.getHazelcastConfigurationFile();
} else {
hazelcastFilePath = serverConfigFile.getParentFile().getAbsolutePath() + File.separator
+ configuration.getHazelcastConfigurationFile();
}
File file = new File(hazelcastFilePath);
if (file.exists()) {
Expand Down

0 comments on commit 5046d41

Please sign in to comment.