[jira] [Commented] (FELIX-4473) [Jetty] Add support for Jetty Connector injection
[ https://issues.apache.org/jira/browse/FELIX-4473?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13956485#comment-13956485 ] J.W. Janssen commented on FELIX-4473: - bq. Actually plain HTTP is enabled by default while HTTPS is disabled by default. Even if you configure HTTPS it is only enabled if the org.apache.felix.https.enable is set to true (or yes) and the HTTPS port is defined (which it is by default). bq. So I think we are probably fine since, also if you configure the embedded HTTPS connector you still have to explicitly disable the plain HTTP connector if you don't want it. Yes, you're right. What I was referring to was that without any configuration, the default HTTP connector is still started. If you want to override this one with a custom connector you need to do deploy an additional bundle anyway, which makes the extra configuration for disabling the default connector not that much of an issue. bq. One additional thing, though: Currently the Jetty server is stopped (aka not started) if neither HTTP nor HTTPS connector are (or can be) started. With the ConnectorFactory we should keep the Jetty server running since a ConnectorFactory service can come at any time. Alternatively starting the Jetty server could be delayed until a ConnectorFactory service becomes available (or default HTTP or HTTPS are configured). Yes, this is something we should fix along with this issue. Delaying the startup of the server until at least one ConnectorFactory or default HTTP/HTTPS connector is configured would have my preference (conceptually cleaner)... Are you going to apply this patch anytime soon? > [Jetty] Add support for Jetty Connector injection > - > > Key: FELIX-4473 > URL: https://issues.apache.org/jira/browse/FELIX-4473 > Project: Felix > Issue Type: Task > Components: HTTP Service >Affects Versions: http-2.2.2 >Reporter: Felix Meschberger > Attachments: FELIX-4473.patch > > > As discussed on the list [1] a ConnectorFactory service is to be defined > which allows the injection of Jetty Connector objects into the running Jetty > server. > package org.apache.felix.http.jetty; > public interface ConnectorFactory { > Connector createConnector(); > } > * createConnector creates a new configured (but not started) Connector > instance on each call > * The Jetty bundle calls createConnector for each Jetty server started (for > now this is a single one). > * The Connector is added to the Jetty server and started > * When the Jetty server stops, the connector is stopped and discarded along > with the Jetty server > * When the ConnectorFactory is stopped, the Connector has to be stopped and > removed from the Jetty server > [1] http://felix.markmail.org/thread/wvnani5362kq5ynr -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (FELIX-4473) [Jetty] Add support for Jetty Connector injection
[ https://issues.apache.org/jira/browse/FELIX-4473?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13955717#comment-13955717 ] Felix Meschberger commented on FELIX-4473: -- bq. there's an unused variable ({{connectors}}) That is a transient variable which turns out to not be needed. Would remove before committing. Thanks for spotting. bq. the default HTTP and/or HTTPS connectors are installed by default Actually plain HTTP is enabled by default while HTTPS is disabled by default. Even if you configure HTTPS it is only enabled if the {{org.apache.felix.https.enable}} is set to true (or yes) and the HTTPS port is defined (which it is by default). So I think we are probably fine since, also if you configure the embedded HTTPS connector you still have to explicitly disable the plain HTTP connector if you don't want it. One additional thing, though: Currently the Jetty server is stopped (aka not started) if neither HTTP nor HTTPS connector are (or can be) started. With the {{ConnectorFactory}} we should keep the Jetty server running since a {{ConnectorFactory}} service can come at any time. Alternatively starting the Jetty server could be delayed until a {{ConnectorFactory}} service becomes available (or default HTTP or HTTPS are configured). > [Jetty] Add support for Jetty Connector injection > - > > Key: FELIX-4473 > URL: https://issues.apache.org/jira/browse/FELIX-4473 > Project: Felix > Issue Type: Task > Components: HTTP Service >Affects Versions: http-2.2.2 >Reporter: Felix Meschberger > Attachments: FELIX-4473.patch > > > As discussed on the list [1] a ConnectorFactory service is to be defined > which allows the injection of Jetty Connector objects into the running Jetty > server. > package org.apache.felix.http.jetty; > public interface ConnectorFactory { > Connector createConnector(); > } > * createConnector creates a new configured (but not started) Connector > instance on each call > * The Jetty bundle calls createConnector for each Jetty server started (for > now this is a single one). > * The Connector is added to the Jetty server and started > * When the Jetty server stops, the connector is stopped and discarded along > with the Jetty server > * When the ConnectorFactory is stopped, the Connector has to be stopped and > removed from the Jetty server > [1] http://felix.markmail.org/thread/wvnani5362kq5ynr -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (FELIX-4473) [Jetty] Add support for Jetty Connector injection
[ https://issues.apache.org/jira/browse/FELIX-4473?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13955590#comment-13955590 ] J.W. Janssen commented on FELIX-4473: - I've looked a bit at the patch, and it looks good! I was able to create my own connector at runtime and it was correctly picked up and started. Two remarks: # there's an unused variable ({{connectors}}) this patch introduces in {{JettyService}} which I believe is not necessary? # the default HTTP and/or HTTPS connectors are installed by default using the configuration values, which means that if I *only* want to use a {{ConnectorFactory}} I've to explicitly configure the service to *not* use the defaults. I'm not sure yet how we can change this without losing the ease of use. Any ideas? > [Jetty] Add support for Jetty Connector injection > - > > Key: FELIX-4473 > URL: https://issues.apache.org/jira/browse/FELIX-4473 > Project: Felix > Issue Type: Task > Components: HTTP Service >Affects Versions: http-2.2.2 >Reporter: Felix Meschberger > Attachments: FELIX-4473.patch > > > As discussed on the list [1] a ConnectorFactory service is to be defined > which allows the injection of Jetty Connector objects into the running Jetty > server. > package org.apache.felix.http.jetty; > public interface ConnectorFactory { > Connector createConnector(); > } > * createConnector creates a new configured (but not started) Connector > instance on each call > * The Jetty bundle calls createConnector for each Jetty server started (for > now this is a single one). > * The Connector is added to the Jetty server and started > * When the Jetty server stops, the connector is stopped and discarded along > with the Jetty server > * When the ConnectorFactory is stopped, the Connector has to be stopped and > removed from the Jetty server > [1] http://felix.markmail.org/thread/wvnani5362kq5ynr -- This message was sent by Atlassian JIRA (v6.2#6252)