[JBoss JIRA] Created: (SHRINKWRAP-89) Java Service Provider methods for the ManifestContainer
by Aslak (JIRA)
Java Service Provider methods for the ManifestContainer
-------------------------------------------------------
Key: SHRINKWRAP-89
URL: https://jira.jboss.org/jira/browse/SHRINKWRAP-89
Project: ShrinkWrap
Issue Type: Feature Request
Reporter: Aslak
Adding a SerivceProvider to a archive is a bit cumbersome..
{code}
.addManifestResource(
"META-INF/services/org.jboss.arquillian.spi.TestRunner",
"services/org.jboss.arquillian.spi.TestRunner");
{code}
How about adding something like this to the ManifestContainer ?
- a ServiceProviderAsset that can handle the file ie:
{code}
<X> addServiceProvider(Class<X> providerInterface, Class<? extends X>... providerImpls)
{
addManifestResource(new ServiceProviderAsset(providerImpls), Paths.create("services/" + providerInterface.getName()));
}
{code}
- a Auto lookup based on ProviderInterface ie:
{code}
addServiceProvider(Class<?> providerInterface)
{
addManifestResource(new ClassLoaderAsset("META-INF/service/" + providerInterface.getName()), Paths.create("services/" + providerInterface.getName()))
}
{code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[JBoss JIRA] Created: (SHRINKWRAP-91) Support for Add Filters on 'multi' add methods
by Aslak (JIRA)
Support for Add Filters on 'multi' add methods
----------------------------------------------
Key: SHRINKWRAP-91
URL: https://jira.jboss.org/jira/browse/SHRINKWRAP-91
Project: ShrinkWrap
Issue Type: Feature Request
Reporter: Aslak
When assembling Archives using methods like:
archive.add(archive)
archive.addPackages(true, Package.getPackage("org.junit"))
it would be useful to have some sort of 'AcceptFilter' to minimize the work.
Usecase -1:
you want to add Package org.junit but NOT junit.org.runners.model. The way it works now is you have to add every single package 'around' the one you want don't want. This can be a pretty big list.
Usecase-2:
You want to merge two archives, but use your own descriptors..
Possible impl..
{code}
interface Filter<T> {
boolean accept(T obj);
}
addPackage(Boolean recursive, Filter<Class<?>> filter, Package... packs)
{
for(Class<?> class : package)
{
if(filter.accept(class))
{
addClass(class);
}
}
}
{code}
This way we could create archives like:
{code}
archive.addPackage(
true,
new RegExpExcludeFilter(".*/models/.*"),
Package.getPackage("org.junit")
)
archive.add(
otherArchive,
new RegExpIncludeFilter("/META-INF/*")
)
{code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 4 months