deploy osgi bundle on jetty of eclipse osgi framework
I have no experience with jetty. I need to deploy my osgi bundle on jetty server. The jetty server is embedded on Eclipse osgi framework. For all the documentation I checked, it is required to use some xml file to do the configuration. I am not sure where can I find such xml files? In development environment, the run configuration set up everything for me:
-Declipse.ignoreApp=true
-Dosgi.noShutdown=true
-Dorg.eclipse.equinox.http.jetty.log.stderr.threshold=info
In the target platform, these bundles are required
org.eclipse.equinox.http.jetty
org.eclipse.jetty.continuation_8.1.16.v20140903
org.eclipse.jetty.http_8.1.16.v20140903
org.eclipse.jetty.io_8.1.16.v20140903
org.eclipse.jetty.security_8.1.16.v20140903
org.eclipse.jetty.server_8.1.16.v20140903
org.eclipse.jetty.servlet_8.1.16.v20140903
org.eclipse.jetty.util_8.1.16.v20140903
I checked Eclipse plugin directory and these are all regular jars. I am not sure how I can set xml configuration from the jar files? The plugin will be deployed on Eclipse IDE for Java EE. So I think I don't need to provide additional jetty server myself since IDE already has the jars? Thanks
Got it working. To deploy a plugin on Eclipse IDE using its shipped equinox http service (by org.eclipse.equinox.http.jetty), first create a bundle fragment and set its host plugin to org.eclipse.equinox.http.jetty. The bundle fragment should have a class extends class org.eclipse.equinox.http.jetty.JettyCustomizer. The class should have a no-arg constructor.
The abstract class JettyCustomizer provides three methods to access to servlet context handlers and http/s connectors. Thus everything could be customized in the concrete class.
To tell the equinox http service to use the concrete customizer, either use -Dorg.eclipse.equinox.http.jetty.customizer.class as VM argument or set it in System property programmatically.
链接地址: http://www.djcxy.com/p/74744.html