Uploaded image for project: 'ShrinkWrap'
  1. ShrinkWrap
  2. SHRINKWRAP-89

Java Service Provider methods for the ManifestContainer

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • 1.0.0-alpha-3
    • None
    • None
    • None

      Adding a SerivceProvider to a archive is a bit cumbersome..

                  .addManifestResource(
                          "META-INF/services/org.jboss.arquillian.spi.TestRunner",
                           "services/org.jboss.arquillian.spi.TestRunner");
      

      How about adding something like this to the ManifestContainer ?

      • a ServiceProviderAsset that can handle the file ie:
                  <X> addServiceProvider(Class<X> providerInterface, Class<? extends X>... providerImpls) 
                  {
                       addManifestResource(new ServiceProviderAsset(providerImpls), Paths.create("services/" + providerInterface.getName()));
                  }
        
      • a Auto lookup based on ProviderInterface ie:
                 addServiceProvider(Class<?> providerInterface) 
                 {
                     addManifestResource(new ClassLoaderAsset("META-INF/service/" + providerInterface.getName()), Paths.create("services/" + providerInterface.getName()))
                 }
        

              arubinge@redhat.com Andrew Rubinger (Inactive)
              aslak@redhat.com Aslak Knutsen
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: