Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jboss.resteasy.cdi.generic;
 
 
 import  javax.enterprise.context.ApplicationScoped;
 import  javax.enterprise.context.RequestScoped;
 import  javax.enterprise.inject.Default;
 import  javax.enterprise.inject.Produces;

Author(s):
Ron Sigal
Version:
$Revision: 1.1 $ Copyright Dec 14, 2012
See also:
https://community.jboss.org/message/784561.784561
@ApplicationScoped
public class GenericsProducer
   @Inject private Logger log;
   
   @Produces
   private ObjectHolder<Objectoh = new ObjectHolder<Object>(Object.class);
    
   @Produces
   private HierarchyHolder<Primatehh = new HierarchyHolder<Primate>(Primate.class);
   
   @Produces
   @Produces
   @Produces
   
   @Produces
   @Produces
   
//   @Produces
//   @RequestScoped
////   @ResourceBinding
//   private UpperBoundTypedResource<HierarchyHolder<Primate>> upperBoundProducer()
//   {
//      UpperBoundTypedResource<HierarchyHolder<Primate>> ubhhr = new UpperBoundTypedResource<HierarchyHolder<Primate>>(Primate.class);
//      System.out.println("GenericsProducer.upperBoundProducer() created: " + ubhhr);
//      return ubhhr;
//   }
//
//   @Produces
////   @ResourceBinding
//   private LowerBoundTypedResource<HierarchyHolder<Primate>> lowerBoundProducer()
//   {
//      LowerBoundTypedResource<HierarchyHolder<Primate>> lbhhr = new LowerBoundTypedResource<HierarchyHolder<Primate>>(Primate.class);
//      System.out.println("GenericsProducer.lowerBoundProducer() created: " + lbhhr);
//      return lbhhr;
//   }
New to GrepCode? Check out our FAQ X