Skip to content

Commit

Permalink
tweak init
Browse files Browse the repository at this point in the history
  • Loading branch information
myronkscott committed Oct 21, 2024
1 parent c0ca785 commit 28e8222
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ public ProductInfo getProductInfo() {
}

public void initialize() throws ConfigurationException {
Lock lock = this.configurationProvider.lockAndInitialize(this.startUpArgs);

try {
Configuration configuration = configurationProvider.getConfiguration();
try (LockedConfiguration configuration = this.configurationProvider.lockAndInitialize(this.startUpArgs)) {
if (configuration == null) {
throw new ConfigurationException("unable to determine server configuration");
}
Expand All @@ -92,8 +89,6 @@ public void initialize() throws ConfigurationException {
thisServer = new StableServerConfiguration(base);

processTcProperties(configuration.getTcProperties());
} finally {
lock.unlock();
}
}

Expand Down Expand Up @@ -300,10 +295,10 @@ List<ServerConfiguration> getStableServerConfigurations() {
}
}

Lock lockAndInitialize(List<String> configurationParams) throws ConfigurationException {
LockedConfiguration lockAndInitialize(List<String> configurationParams) throws ConfigurationException {
lock.lock();
initialize(configurationParams);
return lock;
return new LockedConfiguration(delegateProvider.getConfiguration(), lock);
}

@Override
Expand Down

0 comments on commit 28e8222

Please sign in to comment.