All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.resteasy.cdi.generic.GenericsProducer Maven / Gradle / Ivy

package org.jboss.resteasy.cdi.generic;

import java.util.logging.Logger;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Default;
import javax.enterprise.inject.Produces;
import javax.inject.Inject;

/**
 * 
 * @author Ron Sigal
 * @version $Revision: 1.1 $
 *
 * Copyright Dec 14, 2012
 * 
 * @see https://community.jboss.org/message/784561#784561
 */
@ApplicationScoped
@SuppressWarnings("unused")
public class GenericsProducer
{
   @Inject private Logger log;
   
   @Produces
   @HolderBinding
   private ObjectHolder oh = new ObjectHolder(Object.class);
    
   @Produces
   @HolderBinding
   private HierarchyHolder hh = new HierarchyHolder(Primate.class);
   
   @Produces
   @HolderBinding
   private NestedHierarchyHolder> nhh = new NestedHierarchyHolder>(Primate.class);

   @Produces
   @HolderBinding
   private UpperBoundHierarchyHolder> ubhh = new UpperBoundHierarchyHolder>(Primate.class);

   @Produces
   @HolderBinding
   private LowerBoundHierarchyHolder> lbhh = new LowerBoundHierarchyHolder>(Primate.class);
   
   @Produces
   @ResourceBinding
   private UpperBoundTypedResource> ubhhr = new UpperBoundTypedResource>(Primate.class);

   @Produces
   @ResourceBinding
   private LowerBoundTypedResource> lbhhr = new LowerBoundTypedResource>(Primate.class);
   
//   @Produces
//   @RequestScoped
////   @ResourceBinding
//   private UpperBoundTypedResource> upperBoundProducer()
//   {
//      UpperBoundTypedResource> ubhhr = new UpperBoundTypedResource>(Primate.class);
//      System.out.println("GenericsProducer.upperBoundProducer() created: " + ubhhr);
//      return ubhhr;
//   }
//
//   @Produces
////   @ResourceBinding
//   private LowerBoundTypedResource> lowerBoundProducer()
//   {
//      LowerBoundTypedResource> lbhhr = new LowerBoundTypedResource>(Primate.class);
//      System.out.println("GenericsProducer.lowerBoundProducer() created: " + lbhhr);
//      return lbhhr;
//   }
}