[
https://issues.apache.org/jira/browse/ARTEMIS-3808?focusedWorklogId=769827&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-769827
]
ASF GitHub Bot logged work on ARTEMIS-3808:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 12/May/22 19:03
Start Date: 12/May/22 19:03
Worklog Time Spent: 10m
Work Description: jbertram commented on code in PR #4061:
URL: https://github.com/apache/activemq-artemis/pull/4061#discussion_r871718590
##########
artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java:
##########
@@ -53,115 +54,122 @@
import org.eclipse.jetty.webapp.WebAppContext;
import org.jboss.logging.Logger;
-public class WebServerComponent implements ExternalComponent {
+public class WebServerComponent implements ExternalComponent,
WebServerComponentMarker {
private static final Logger logger =
Logger.getLogger(WebServerComponent.class);
+ public static final String DIR_ALLOWED =
"org.eclipse.jetty.servlet.Default.dirAllowed";
private Server server;
private HandlerList handlers;
- private WebServerDTO webServerConfig;
+ private WebServerDTO config;
private final List<String> consoleUrls = new ArrayList<>();
private final List<String> jolokiaUrls = new ArrayList<>();
- private List<WebAppContext> webContexts;
+ private List<WebAppContext> webContexts = new ArrayList<>();;
private ServerConnector[] connectors;
private Path artemisHomePath;
private Path temporaryWarDir;
+ private String artemisInstance;
+ private String artemisHome;
@Override
public void configure(ComponentDTO config, String artemisInstance, String
artemisHome) throws Exception {
- webServerConfig = (WebServerDTO) config;
- server = new Server();
-
- HttpConfiguration httpConfiguration = new HttpConfiguration();
+ this.config = (WebServerDTO) config;
+ this.artemisInstance = artemisInstance;
+ this.artemisHome = artemisHome;
- if (webServerConfig.customizer != null) {
- try {
- httpConfiguration.addCustomizer((HttpConfiguration.Customizer)
Class.forName(webServerConfig.customizer).getConstructor().newInstance());
- } catch (Throwable t) {
-
ActiveMQWebLogger.LOGGER.customizerNotLoaded(webServerConfig.customizer, t);
- }
+ temporaryWarDir = Paths.get(artemisInstance != null ? artemisInstance :
".").resolve("tmp").resolve("webapps").toAbsolutePath();
+ if (!Files.exists(temporaryWarDir)) {
+ Files.createDirectories(temporaryWarDir);
}
+ }
- List<BindingDTO> bindings = webServerConfig.getBindings();
- connectors = new ServerConnector[bindings.size()];
- String[] virtualHosts = new String[bindings.size()];
-
- for (int i = 0; i < bindings.size(); i++) {
- BindingDTO binding = bindings.get(i);
- URI uri = new URI(binding.uri);
- String scheme = uri.getScheme();
- ServerConnector connector;
+ private RequestLogHandler getLogHandler() {
Review Comment:
I think this is mainly due to the way the diff algorithm works, but I
rearranged some stuff to eliminate it.
Issue Time Tracking
-------------------
Worklog Id: (was: 769827)
Time Spent: 4h 10m (was: 4h)
> Support starting/stopping the embedded web server via mangement
> ---------------------------------------------------------------
>
> Key: ARTEMIS-3808
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3808
> Project: ActiveMQ Artemis
> Issue Type: Improvement
> Reporter: Justin Bertram
> Assignee: Justin Bertram
> Priority: Major
> Time Spent: 4h 10m
> Remaining Estimate: 0h
>
> It would be useful to be able to cycle the embedded web server if, for
> example, one needed to renew the SSL certificates.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)