-
1. Re: Mapping HttpService to JBossWeb
dknox Apr 14, 2010 10:59 PM (in response to thomas.diesler)>> Perhaps you can take the four methods from HttpService (http://www.osgi.org/javadoc/r4v42/org/osgi/service/http/HttpService.html) and map >> them to whatever you think is appropriate. I can map addServlet to the Servlet 3 API. How about the other methods?
createDefaultHttpContext - the implementation is a factory method. It doesn't map to directly to the Servlet 3.0 API. The model code Remy found could be a good place to start. I reviewed it, but not deeply.
registerResources - This needs more digging, however the ServletContext allows access to resources.
registerServlet - Maps to addServlet(String name, Servlet s). The ServletRegistration object allows further configuration (initparams for example). There are still questions/problems, but I can start prototyping here.
unregister - maybe use JMX?
Message was edited by: David Knox
-
2. Re: Mapping HttpService to JBossWeb
thomas.diesler Apr 15, 2010 7:20 AM (in response to dknox)unregister - maybe use JMX?
The HttpService does not have a dependency on org.osgi.jmx and neither should it. Pluggability is at the heart of OSGi, so it should be possible to take the Felix or Equinox framework and install the jboss-osgi-http bundle on it. The only package (i.e. API) that is exported from that bundle is org.osgi.service.http everyting else should be private.
There may be additional functionality that this bundle provides (i.e. a management interface). In that case it would optionally import the org.osgi.jmx package and track the jboss-osgi-jmx provided MBeanServer service.
-
3. Re: Mapping HttpService to JBossWeb
rmaucher Apr 15, 2010 10:34 AM (in response to dknox)registerResources - This needs more digging, however the ServletContext allows access to resources.
Apparently, this needs to go through the HttpContext.
registerServlet - Maps to addServlet(String name, Servlet s). The ServletRegistration object allows further configuration (initparams for example). There are still questions/problems, but I can start prototyping here.
I think you should add a wrapper, and populate it.
Overall, the existing code I found looks probably fine with some minor fixes, so we should start from it (rather than the other way around).
-
4. Re: Mapping HttpService to JBossWeb
dknox Apr 15, 2010 11:22 AM (in response to thomas.diesler)Hi, I noted that JMX instrumentation could be used from HttpServer to fill whatever gaps we have in the Servlet3 API. The sample code that Remy found is a bridge to a facade called Tomcat6Service. The only way they would have to register/unregister would be through Tomcat6 internals; MBean instrumentation would make up a good portion of those internals. I noted also that any annotations in the Servlet class passed in HttpService::registerServlet will be processed when ServletContext::addServlet is called.
-
5. Re: Mapping HttpService to JBossWeb
rmaucher Apr 15, 2010 11:38 AM (in response to dknox)Tomcat6Service is start/stop/configure the container. Nothing really new. All these tasks that are done by TomcatService in the "tomcat" module in AS, so this needs to be adapted using the OSGI way (and without JMX ): create a Catalina instance, configure the connectors, and add engine and host to be able to create the Contexts.
-
6. Re: Mapping HttpService to JBossWeb
thomas.diesler Apr 20, 2010 3:47 AM (in response to rmaucher)sounds good
-
7. Re: Mapping HttpService to JBossWeb
dknox Apr 21, 2010 2:06 PM (in response to thomas.diesler)Project repository URL: http://github.com/jbosgi/jbosgi-http
Haven't played with GIT yet.
--dave
Message was edited by: David Knox
-
8. Re: Mapping HttpService to JBossWeb
dknox Apr 21, 2010 2:09 PM (in response to thomas.diesler)Thomas,
I was trying to run the examples in 1.0.0.Beta7 and tests. It appears that 1.0.0.Beta7/jboss-osgi-testsuite-1.0.0.Beta7.pom hasn't been added to the repository yet. Is Beta7 necessary for the testsuite? or will editing the pom to fall back fto 1.0.0.Beta6 work around it for now?
cheers,
-- dave
-
9. Re: Mapping HttpService to JBossWeb
thomas.diesler Apr 22, 2010 6:53 AM (in response to dknox)Yes, that got lost during the maven repo migration. Please try again.
-
10. Re: Mapping HttpService to JBossWeb
dknox Apr 22, 2010 2:28 PM (in response to thomas.diesler)Hi Thomas,
The same result using mvn -f, browser, or wget - Beta7 can't be found.
http://repository.jboss.org/maven2/org/jboss/osgi/testsuite/jboss-osgi-testsuite/
doesn't contain the Beta7 directory.
cheers,
-- dave
-
11. Re: Mapping HttpService to JBossWeb
thomas.diesler Apr 26, 2010 10:30 AM (in response to dknox)You are looking at the wrong repo.
The build should work when you've done this
-
12. Re: Mapping HttpService to JBossWeb
dknox Apr 26, 2010 3:16 PM (in response to thomas.diesler)Hi,
The tests ran successfully once my maven settings where set to the new maven repository. Now I'm working on getting git to clone the project without complaining. Wnen I do that, I'll move what code I have into git.
My bit of prototyping right now depnds on osgi.cmpn.jar for version 4.1, which contains the org.osgi.service API definitions. Will that change when the code is better integrated with the project?
thanks,
-- dave
-
13. Re: Mapping HttpService to JBossWeb
thomas.diesler Apr 27, 2010 9:44 AM (in response to dknox)Yes, you need to use
<dependency> <groupId>org.osgi</groupId> <artifactId>org.osgi.enterprise</artifactId> <version>${version.osgi}</version> </dependency>
http://github.com/jbosgi/jbosgi-http/blob/master/pom.xml
when you do the webapp integration. For HttpService use
<dependency> <groupId>org.osgi</groupId> <artifactId>org.osgi.compendium</artifactId> <version>${version.osgi}</version> </dependency>
version.osgi == 4.2.0
Note, there is currently ongoing discussion about the missing org.osgi.enterprise jar in maven central.
In the meantime you can get it from here http://www.osgi.org/Download/File?url=/download/r4v42/osgi.enterprise.jar -
14. Re: Mapping HttpService to JBossWeb
dknox Apr 27, 2010 12:43 PM (in response to thomas.diesler)where is that discussion? My searches didn't produce it. The reason I ask is the contents of osgi.enterprise.jar and osgi.cmpn.jar are not mutually exclusive. Maybe reading the discussion will help clear this up.
cheers!