While using the ShrinkWrap API to manipulate archives in the Arquillian deployment packager, I felt a real lack of read method options on the archive types. A prime example is when I want to read the WebArchives that are contained within an EnterpriseArchive.
My first thought was that I could use a filter to isolate the content I wanted. However, the Filter API doesn't seem to support an archive type. Perhaps it's just a matter of creating a new Filter implementation that first finds all nested archives and then passes that to the callback method for further filtering.
I think it would also be nice to have convenience methods on EnterpriseArchive to get all the modules and the modules by type.
Set<WebArchive> EnterpriseArchive#getModules() Set<WebArchive> EnterpriseArchive#getWebModules() Set<WebArchive> EnterpriseArchive#getEjbModules()
Then expand this set for the absolutely core structures of the different types. Forcing everything through getContent(Filter<T>) is a touch tedious
I believe an ideal solution that would provide limitless possiblitity is to introduce a content query API, similar to the bean property query API in Weld Extensions.
I've filed an issue, in which I provide more details: SHRINKWRAP-236
|Retrieving data ...|