Skip to content

Commit

Permalink
SOLDER-22
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Mar 24, 2011
1 parent a61f83f commit 38349af
Showing 1 changed file with 16 additions and 8 deletions.
Expand Up @@ -16,8 +16,8 @@
*/
package org.jboss.seam.solder.unwraps;

import java.util.HashSet;
import java.util.Set;
import org.jboss.logging.Logger;
import org.jboss.seam.solder.reflection.Reflections;

import javax.enterprise.event.Observes;
import javax.enterprise.inject.spi.AfterBeanDiscovery;
Expand All @@ -26,16 +26,16 @@
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.Extension;
import javax.enterprise.inject.spi.ProcessAnnotatedType;

import org.jboss.logging.Logger;
import org.jboss.seam.solder.reflection.Reflections;
import java.lang.annotation.Annotation;
import java.util.HashSet;
import java.util.Set;

/**
* An extension that allows the use of {@link Unwraps} methods
*
*
*
*
* @author Stuart Douglas
*
*
*/
public class UnwrapsExtension implements Extension
{
Expand Down Expand Up @@ -76,6 +76,14 @@ void processAnnotatedType(@Observes ProcessAnnotatedType<?> type, BeanManager be
}
else
{
for(Annotation annotation : method.getAnnotations())
{
if(beanManager.isScope(annotation.annotationType()))
{
problems.add(new RuntimeException("@Unwraps producer method declared a scope: " + method));
}
}

// we have a managed producer
// lets make a note of it and register it later
beans.add(createBean(method, beanManager));
Expand Down

0 comments on commit 38349af

Please sign in to comment.