Expose Jetty ports in the Admin API (such as the SslSelectChannelConnector used for HTTPS)

Description

Please expose the ports for the following connectors:
1. org.eclipse.jetty.server.ssl.SslSelectChannelConnector
2. org.eclipse.jetty.server.ssl.SslSelectChannelConnector (different)
3. org.eclipse.jetty.server.nio.SelectChannelConnector

a) Provide the actual port used by each connector as context attributes using a naming scheme to avoid clashes. This could be jetty.<connector-name>.port.actual if the connector has been given a name.
b) Given that the ServletContext is actually an inner class whose outer class instance has a reference to a org.eclipse.jetty.server.Server which has everything would it be out of the question to make the org.eclipse.jetty.server.Server available as a context attribute?

Attached the jetty xml file.

For testing please do the following:
1. download XAP 12.3.0
2. create project using <XAP 12.3.0>/examples/web-app/web-space-access/pom.xml
3. <XAP 12.3.1>replace the original /examples/web-app/web-space-access/src/main/java/com/gigaspaces/examples/web/AccessSpaceServlet.java with the attached AccessSpaceServlet.java
4. follow /examples/web-app/web-space-access/README.html instructions.
5. in the console check for:
>>>jettySelectChannelConnector=" + jettySelectChannelConnectorPort + " not yet implemented");
>>>jettySelectChannelConnectorPortA=" + jettySelectChannelConnectorPortA + " not yet implemented");
>>>jettySelectChannelConnectorPortB=" + jettySelectChannelConnectorPortB + " not yet implemented");

30.8.18 We delivered the patch to the customer.
16.9.18 I reopened this feature request because when the customer deployed 2 WARS sharing the same jetty.pu.xml on the same GSC, the attribute jetty.[CONNECTOR_NAME].port.actual has been seen for the first WAR but doesn't exist at all for the second WAR.

Reproduction:
1. download http://gigaspaces-releases-eu.s3.amazonaws.com/com/gigaspaces/xap-core/xap-large-cluster/xap-webui-14.0.0-SNAPSHOT.war
2. duplicate xap-webui-14.0.0-SNAPSHOT.war to a different name like xap-webui-14.0.0-SNAPSHOT1.war
3. copy both xap-webui-14.0.0-SNAPSHOT.war and xap-webui-14.0.0-SNAPSHOT1.war under the deploy dir of the patch we have provided at 30.8.18 (gigaspaces-xap-12.3.0-ga-b19020)
3. start gs-agent - ./gs-agent.sh --manager-local --gsc=1
4. run gs.sh
5. deploy xap-webui-14.0.0-SNAPSHOT.war with shared mode - deploy -properties embed://jetty.instance=shared xap-webui-14.0.0-SNAPSHOT
6. click on "Deployed Processing Units" tab in the gs-ui and then click on the link under "JEE Application Summary". This will open the web-ui on your browser and print all "Servlet Context Attributes names and values" in the gsc log. The following attributes can be seen:
Attribute=jetty.MYCONNECTOR42.port.actual, value=8340
Attribute=jetty.MYCONNECTOR40.port.actual, value=8328
Attribute=jetty.MYCONNECTOR41.port.actual, value=8329
7. repeat steps 5-6 for the second WAR.
8. check the gsc.log:

expected results:
Attribute=jetty.MYCONNECTOR42.port.actual, value=8341
Attribute=jetty.MYCONNECTOR40.port.actual, value=8330
Attribute=jetty.MYCONNECTOR41.port.actual, value=8331

actual results:
this attributes are missing!

We need to support also shared mode and not just plain mode. See here:
https://docs.gigaspaces.com/xap/12.3/dev-java/web-jetty-processing-unit-container.html#jetty-instance-handling

Acceptance Test

manual

Assignee

Niv Ingberg

Reporter

Yuval Dori

Labels

None

Priority

Blocker

SalesForce Case ID

11964

Fix versions

Commitment Version/s

None

Due date

None

Product

XAP

Edition

Enterprise

Platform

All
Configure