[jboss-dev-forums] [Embedded JBoss Development] - Re: ShrinkWrap - Descriptors

aslak do-not-reply at jboss.com
Wed Sep 30 02:58:55 EDT 2009


Ok, I've done a little test with the 'Specializes' style.

http://shrinkwrap.pastebin.com/mdca7a45

Short v:
- new interface Spercializer
- Archive extends Specializer and performs the lookup via ArchiveExtensionLoader
- SpecializerBase impl Specializer with delegation to Archive
- ContainerBase extends SpecializerBase
- WebArchiveDescriptor extends Specializer
- WebArchiveDescriptorAsset extends SpecializerBasse impl Asset, WebArchiveDescriptor


The new SPI looks like:
 - implements Spercialized
 - 1 argument constructor that extends Archive

The ArchiveExtensionLoader will try to do lookups recursive, so in the  WebArchiveDescriptorAsset case, the flow is:
- Lookup impl for WebArchiveDescriptor based on WebArchiveDesctiptor META-INF/Service/... 
- Find suitable constructor on found class
- Finds constrcutor with argument WebArchive
  -- Lookup impl for WebArchive ..
  -- Find suitable constrcutor
  -- Construct WebArchiveImpl with given Archive
- Construct WebArchiveDescriptorAsset with WebArchiveImpl


A side effect of this change is that we can move the spec impls and descriptor impls over to the SPI package, since they now are actually loaded dynamically.

(ps: ignore the horrible ArchiveExtensionLoader impl for now.. :)

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257788#4257788

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4257788



More information about the jboss-dev-forums mailing list