Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-1876

Addon services should be exposed through @Produces methods

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 2.7.0.Final
    • 2.6.0.Final
    • Furnace CDI
    • None

      Having an addon that depends on the furnace-cdi container and declares the following class:

      import javax.enterprise.inject.Produces;
      import javax.ws.rs.client.Client;
      import javax.ws.rs.client.ClientBuilder;
      
      public class RestClientProducer
      {
      
         @Produces
         public ClientBuilder createClientBuilder()
         {
            ClientBuilder builder = ClientBuilder.newBuilder();
            return builder;
         }
      
         @Produces
         public Client createClient(ClientBuilder builder)
         {
            return builder.build();
         }
      }
      

      Then:

      • WeldServiceRegistry.hasService(javax.ws.rs.client.Client.class) should return true
      • AddonRegistry.getServices(javax.ws.rs.client.Client.class).get() should call the producer method and return the requested service

              rhn-support-ggastald George Gastaldi
              rhn-support-ggastald George Gastaldi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: