dev@glassfish.java.net

Re: About the GLASSFISH-16651

From: <hong.hz.zhang_at_oracle.com>
Date: Fri, 06 Jul 2012 10:18:45 -0400

Hi, Tang
Thanks for contributing to the GlassFish!

For step 2, did you mean --type osgi instead of --type wab? I don't
think we want to introduce another type here..

I think we already have an archive handler for OSGI today
(main/appserver/extras/osgi-container/src/main/java/org/glassfish/extras/osgicontainer/OSGIArchiveHandler),
maybe we could re-use that class instead of adding a new class, but
Sahoo is the expert in this area so I will let him comment on it.

Thanks,

- Hong

On 7/6/2012 3:05 AM, Tang Yong wrote:
> Dear Sahoo
> CC: Hong Zhang
>
> I have made a prototype of GLASSFISH-16651 and put the modified files
> into https://github.com/tangyong/GLASSFISH-16651 .
>
> Currently, the prototype can work for me. If using the following way,
> plain vanilla WAR can be wraped WAB(osgi rfc#66) and can be accessed
> from Brawser.
>
> 1 asadmin start-domain
>
> 2 asadmin deploy --type=wab
> e:\test_sample1.war?Web-ContextPath=/test_sample1"
>
> 3 access "http://localhost:8080/test_sample1/" and "Hello! Servlet3.0
> Sample1111111111" appeared!
>
> In addtion, after teleneting localhost 6666, executing "lb" on shell,
> and will find the following bundle info:
>
> " 274|Active | 1|org.glassfish.fighterfish.autogenerated_0 (0.0.0)"
>
> [My Design Idea]
> The critical point is to find the integration point between the deploy
> moudle and fighterfish\module\osgi-web-container moudle. So, I made a
> new subclass of GenericHandler called(OSGiWABArchiveHandler) in
> org\glassfish\extras\osgicontainer. Then, in the "expand" method, add
> the following logic:
>
> 1) getting WebBundleURLStreamHandlerService service from osgi registry
> 2) while the deploy process is expanding war, rewrite the war's Manifest
>
> If having time, wish you can see it and I will continue to contribute it
> according your suggestions.
>
> BTW: when I made the prototype, I found that some dependency declarings
> of pom file in the fighterfish\module(etc.osgi-web-container) did not
> keep consistent with GFv4 main/pom.xml, such as:
>
> <dependency>
> <groupId>org.glassfish.web</groupId>
> <artifactId>web-glue</artifactId>
> </dependency>
>
> In GFv4, the groupId of web-glue has changed into org.glassfish.main.web.
>
> --Best Regard!
> --Tang
>