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

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


     [ https://issues.jboss.org/browse/FORGE-1876?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

George Gastaldi closed FORGE-1876.
----------------------------------

         Assignee: George Gastaldi
    Fix Version/s: 2.6.1.Final
                       (was: 2.x Future)
       Resolution: Done


> 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
>            Assignee: George Gastaldi
>             Fix For: 2.6.1.Final
>
>
> 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}
> 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



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


More information about the forge-issues mailing list