[
https://issues.jboss.org/browse/SHRINKDESC-119?page=com.atlassian.jira.pl...
]
Aslak Knutsen commented on SHRINKDESC-119:
------------------------------------------
Just to note: The original API proposal was built on the idea that the Descriptor
API would be completely different from what it is now. This 'prototype' should not
be used as is, but rather as a concept idea.
The general idea would be; we need a way to plug in 'builders' to write parts of
the Descriptor based on reading some external data source, e.g. Class level annotations.
These builds should be capable of reasoning on the the structure of the core Descriptor
and relations between elements. e.g. Adding a Class as a Servlet could write both Servlet
and Servlet Mapping information to the Descriptor.
Create a Builder SPI
--------------------
Key: SHRINKDESC-119
URL:
https://issues.jboss.org/browse/SHRINKDESC-119
Project: ShrinkWrap Descriptors
Issue Type: Feature Request
Reporter: Andrew Rubinger
Apart from the SWD object model, we could make it much easier to populate the metadata by
introducing a "Builder" (name to be discussed) SPI. The purpose here would be a
pluggable mechanism to accomplish code like the following:
{code}WebAppDescriptor desc = create(WebAppDescriptor.class)
.add(type(Servlet.class)
.className("com.acme.MyServlet")
.name("MyServletName"))
.add(build(Servlet.class)
.from(MyServlet.class));{code}
Here the WepAppDescriptor gets data added by scanning in annotations observed on the
user's MyServlet, relieving the user of supplying the configuration manually.
A more full example is detailed in this Gist contributed by Aslak:
https://gist.github.com/1025597
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira