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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
|