13 Replies Latest reply on Apr 25, 2012 4:05 AM by Magesh Bojan

    deducing host and port in new HTTP Gateway

    David Ward Master

      regarding https://jira.jboss.org/jira/browse/JBESB-2824 ...

      It's super easy to register a new HTTPEpr to the registry in HttpGatewayServlet.init() and unregister it in destroy(). I even added a loadOnStartup flag to the Servlet model so as soon as this servlet deploys the init is called.

      I get the scheme based on how the user configured this
      http://www.jboss.org/community/wiki/HTTPGateway#Security
      for transport guarantee.

      I get the context path easily enough in it from config.getServletContext().getContextPath().

      I re-use the logic in HttpGatewayDeploymentFactory to figure out the url-pattern for the servlet path.

      I have all the makings of a complete endpoint address, however what I'm scratching my head about is how to deduce the host and port. Looking up the tomcat Connector in the JMX MBean Server is not gonna work because the MBean Object Name has the darn port embedded in it: a Catch-22.

      Any ideas? The rest of this is brain-dead easy... Thanks!