[forge-issues] [JBoss JIRA] (FORGE-1876) Addon services should be exposed through @Produces methods

George Gastaldi (JIRA) issues at jboss.org
Tue Jun 10 00:43:15 EDT 2014


George Gastaldi created FORGE-1876:
--------------------------------------

             Summary: Addon services should be exposed through @Produces methods 
                 Key: FORGE-1876
                 URL: https://issues.jboss.org/browse/FORGE-1876
             Project: Forge
          Issue Type: Enhancement
          Components: Furnace CDI
    Affects Versions: 2.6.0.Final
            Reporter: George Gastaldi
             Fix For: 2.x Future


Having an addon that depends on the furnace-cdi container and declares the following class:
{code}
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();
   }
}
{code}

{{AddonRegistry.getServices(javax.ws.rs.client.Client.class).get()}} should call the producer method and return the requested service



--
This message was sent by Atlassian JIRA
(v6.2.3#6260)


More information about the forge-issues mailing list