Perhaps I don't understand jetty as well as I thought or I am missing your idea here but why does the JettyServer create and start a new Jetty server every time a servlet mapping is added? IIRC, previously JettyServiceImpl used to start one Jetty server and register every new servlet that was added with this server. It seems to me that now we may be wasting resources, e.g., http ports.
On 4/15/07, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote:
I just made some changes to the tuscany-http-* modules to allow servlets to be registered with a Tomcat or Jetty server. I guess this is going to be useful in Servlet based bindings like the WebService or JSONRPC bindings. Here's how to use this capability. In a binding, do this: ExtensionPointRegistry extensionPointRegistry; <-- passed to your ModuleActivator start method. ServletHostExtensionPoint servletHosts = extensionPointRegistry.getExtensionPoint(ServletHostExtensionPoint.class); servletHosts.addServletMapping(yourServlet); The ServletHost interface from module tuscany-http replaces the old ServletHost interface from tuscany-core-spi, which will have to be deleted. In a sample or integration test: - Add the tuscany-http-tomcat or tuscany-http-jetty to your dependencies, depending on which server you want to use. Here's how it works: - I have defined ServletHostExtensionPoint in tuscany-http. That module contributes the extension point in its ModuleActivator. - The tuscany-http-jetty and tuscany-http-tomcat respectively register in this extension point their ServletHost extensions. More to do later: - change the addServletMapping to take more configuration info (like the HTTPS port number for example). - add logic to the ServletHostExtensionPoint to handle multiple ServletHosts and select the best one from what's passed to addServletMapping. Hope this helps... -- Jean-Sebastien --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
