Integrating Equinox OSGi into Apache Tomcat web app

前端 未结 1 533
情书的邮戳
情书的邮戳 2021-01-05 17:59

Is it possible to introduce osgi-equinox into existing java Apache Tomcat project? From my understanding OSGI must run inside some kind of \"container\". How would I integra

相关标签:
1条回答
  • 2021-01-05 18:40

    You may want to look at this question: OSGI runtime inside traditional Java EE server.

    In this bridge model, a special servlet is installed and Tomcat invokes this servlet to handle the request. An OSGi runtime is spawned from within this servlet, but the OSGi runtime itself (e.g. equinox) is agnostic of things like HTTP. An OSGi HTTP service bundle is also installed, and you'll need to register your web app (servlet, jsp, ...) against this OSGi HTTP service to handle the incoming requests. Therefore, it is not like there is a separate "web server" to speak of that listens on its own port and manages HTTP on its own outside Tomcat. Your mileage may vary, but the overhead is basically limited to whatever the OSGi HTTP service might add when it forwards the request from the Tomcat connector to your servlet.

    This bridge model is needed if you cannot change the existing deployment model. In the long run, a better model is to have the OSGi runtime first and have Tomcat (or any other OSGi-compliant container) plug into the OSGi runtime as bundles.

    0 讨论(0)
提交回复
热议问题