Skip to content

Commit

Permalink
GH #25039 Improvements based on review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
OndroMih committed Jul 16, 2024
1 parent 97767d5 commit dc5613f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion appserver/admingui/commandrecorder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
public class CommandRecorder {

@Inject
Instance<CommandRunner> commandRunnerprovider;
Instance<CommandRunner> commandRunnerProvider;

@Inject
Instance<ActionReport> actionReportProvider;
Expand All @@ -54,7 +54,7 @@ public void setEnabled(boolean enabled) {
}

private void setSystemProperty(AdminCommandLogger.LogMode propertyValue) {
final CommandRunner.CommandInvocation commandInvocation = commandRunnerprovider.get().getCommandInvocation("create-system-properties", actionReportProvider.get(), subjectProvider.get());
final CommandRunner.CommandInvocation commandInvocation = commandRunnerProvider.get().getCommandInvocation("create-system-properties", actionReportProvider.get(), subjectProvider.get());
commandInvocation.parameters(parameters(propertyValue)).execute();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/
public class AdminGuiApplication extends ApplicationWrapper {

ViewHandler defaultViewHandler = null;
ViewHandler defaultViewHandler;

public AdminGuiApplication(Application wrapped) {
super(wrapped);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
public class AdminGuiViewHandler extends ViewHandlerWrapper {

private ViewHandler defaultViewHandler = null;
private ViewHandler defaultViewHandler;

public AdminGuiViewHandler(ViewHandler wrapped) {
super(wrapped);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ private void configureJsp(WebModule webModule) {
ServiceLocator defaultServices = webContainer.getServerContext().getDefaultServices();
final String servicesName = webModule.getComponentId();
ServiceLocator webAppServices = ServiceLocatorFactory.getInstance().create(servicesName, defaultServices);
initializeChildServices(webAppServices, Thread.currentThread().getContextClassLoader());
initializeServicesFromClassLoader(webAppServices, Thread.currentThread().getContextClassLoader());

// set services for jsf injection
servletContext.setAttribute(Constants.HABITAT_ATTRIBUTE, webAppServices);
Expand Down Expand Up @@ -272,16 +272,14 @@ private void configureJsp(WebModule webModule) {

}

private static void initializeChildServices(ServiceLocator serviceLocator, ClassLoader childClassLoader) {
private static void initializeServicesFromClassLoader(ServiceLocator serviceLocator, ClassLoader classLoader) {
DynamicConfigurationService dcs =
serviceLocator.getService(DynamicConfigurationService.class);
Populator populator = dcs.getPopulator();
try {
populator.populate(new ClasspathDescriptorFileFinder(childClassLoader));
} catch (IOException ex) {
Logger.getLogger(WebModuleListener.class.getName()).log(Level.SEVERE, null, ex);
} catch (MultiException ex) {
Logger.getLogger(WebModuleListener.class.getName()).log(Level.SEVERE, null, ex);
populator.populate(new ClasspathDescriptorFileFinder(classLoader));
} catch (IOException | MultiException ex) {
_logger.log(Level.SEVERE, ex, ex::getMessage);
}
}

Expand Down

0 comments on commit dc5613f

Please sign in to comment.