Skip to content

Commit

Permalink
rename WB* classes
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@3895 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
sbryzak committed Oct 8, 2009
1 parent 70ab850 commit d6a4540
Show file tree
Hide file tree
Showing 85 changed files with 856 additions and 855 deletions.
26 changes: 13 additions & 13 deletions impl/src/main/java/org/jboss/weld/BeanManagerImpl.java
Expand Up @@ -63,13 +63,13 @@
import org.jboss.weld.bean.proxy.ClientProxyProvider;
import org.jboss.weld.bootstrap.api.ServiceRegistry;
import org.jboss.weld.context.CreationalContextImpl;
import org.jboss.weld.context.WBCreationalContext;
import org.jboss.weld.context.WeldCreationalContext;
import org.jboss.weld.ejb.EjbDescriptors;
import org.jboss.weld.ejb.spi.EjbDescriptor;
import org.jboss.weld.el.Namespace;
import org.jboss.weld.el.WeldELResolver;
import org.jboss.weld.el.WeldExpressionFactory;
import org.jboss.weld.introspector.WBAnnotated;
import org.jboss.weld.introspector.WeldAnnotated;
import org.jboss.weld.literal.AnyLiteral;
import org.jboss.weld.literal.DefaultLiteral;
import org.jboss.weld.log.Log;
Expand All @@ -80,7 +80,7 @@
import org.jboss.weld.resolution.NameBasedResolver;
import org.jboss.weld.resolution.Resolvable;
import org.jboss.weld.resolution.ResolvableFactory;
import org.jboss.weld.resolution.ResolvableWBClass;
import org.jboss.weld.resolution.ResolvableWeldClass;
import org.jboss.weld.resolution.TypeSafeBeanResolver;
import org.jboss.weld.resolution.TypeSafeDecoratorResolver;
import org.jboss.weld.resolution.TypeSafeInterceptorResolver;
Expand Down Expand Up @@ -699,10 +699,10 @@ public void setEnabledInterceptorClasses(List<Class<?>> enabledInterceptorClasse

public Set<Bean<?>> getBeans(Type beanType, Annotation... bindings)
{
return getBeans(ResolvableWBClass.of(beanType, bindings, this), bindings);
return getBeans(ResolvableWeldClass.of(beanType, bindings, this), bindings);
}

public Set<Bean<?>> getBeans(WBAnnotated<?, ?> element, Annotation... bindings)
public Set<Bean<?>> getBeans(WeldAnnotated<?, ?> element, Annotation... bindings)
{
for (Annotation annotation : element.getAnnotations())
{
Expand Down Expand Up @@ -739,7 +739,7 @@ public Set<Bean<?>> getInjectableBeans(InjectionPoint injectionPoint)
currentInjectionPoint.get().push(injectionPoint);
}
// TODO Do this properly
Set<Bean<?>> beans = getBeans(ResolvableWBClass.of(injectionPoint.getType(), injectionPoint.getQualifiers().toArray(new Annotation[0]), this));
Set<Bean<?>> beans = getBeans(ResolvableWeldClass.of(injectionPoint.getType(), injectionPoint.getQualifiers().toArray(new Annotation[0]), this));
Set<Bean<?>> injectableBeans = new HashSet<Bean<?>>();
for (Bean<?> bean : beans)
{
Expand Down Expand Up @@ -903,9 +903,9 @@ public Context getContext(Class<? extends Annotation> scopeType)
public Object getReference(Bean<?> bean, CreationalContext<?> creationalContext)
{
bean = getMostSpecializedBean(bean);
if (creationalContext instanceof WBCreationalContext<?>)
if (creationalContext instanceof WeldCreationalContext<?>)
{
creationalContext = ((WBCreationalContext<?>) creationalContext).getCreationalContext(bean);
creationalContext = ((WeldCreationalContext<?>) creationalContext).getCreationalContext(bean);
}
if (getServices().get(MetaAnnotationStore.class).getScopeModel(bean.getScope()).isNormal())
{
Expand Down Expand Up @@ -957,9 +957,9 @@ public Object getReference(InjectionPoint injectionPoint, Bean<?> resolvedBean,
throw new UnproxyableResolutionException("Attempting to inject an unproxyable normal scoped bean " + resolvedBean + " into " + injectionPoint);
}
// TODO Can we move this logic to getReference?
if (creationalContext instanceof WBCreationalContext<?>)
if (creationalContext instanceof WeldCreationalContext<?>)
{
WBCreationalContext<?> wbCreationalContext = (WBCreationalContext<?>) creationalContext;
WeldCreationalContext<?> wbCreationalContext = (WeldCreationalContext<?>) creationalContext;
if (wbCreationalContext.containsIncompleteInstance(resolvedBean))
{
return wbCreationalContext.getIncompleteInstance(resolvedBean);
Expand All @@ -986,7 +986,7 @@ public Object getReference(InjectionPoint injectionPoint, Bean<?> resolvedBean,

public Object getInjectableReference(InjectionPoint injectionPoint, CreationalContext<?> creationalContext)
{
WBAnnotated<?, ?> element = ResolvableWBClass.of(injectionPoint.getType(), injectionPoint.getQualifiers().toArray(new Annotation[0]), this);
WeldAnnotated<?, ?> element = ResolvableWeldClass.of(injectionPoint.getType(), injectionPoint.getQualifiers().toArray(new Annotation[0]), this);
Bean<?> resolvedBean = getBean(element, element.getBindingsAsArray());
return getReference(injectionPoint, resolvedBean, creationalContext);
}
Expand All @@ -1012,7 +1012,7 @@ public <T> T getInstanceByType(Class<T> beanType, Annotation... bindings)
return instance;
}

public <T> Bean<T> getBean(WBAnnotated<T, ?> element, Annotation... bindings)
public <T> Bean<T> getBean(WeldAnnotated<T, ?> element, Annotation... bindings)
{
Bean<T> bean = (Bean<T>) resolve(getBeans(element, bindings));
if (bean == null)
Expand Down Expand Up @@ -1371,7 +1371,7 @@ public ExpressionFactory wrapExpressionFactory(ExpressionFactory expressionFacto
return new WeldExpressionFactory(expressionFactory);
}

public <T> WBCreationalContext<T> createCreationalContext(Contextual<T> contextual)
public <T> WeldCreationalContext<T> createCreationalContext(Contextual<T> contextual)
{
return new CreationalContextImpl<T>(contextual);
}
Expand Down
22 changes: 11 additions & 11 deletions impl/src/main/java/org/jboss/weld/SimpleInjectionTarget.java
Expand Up @@ -28,9 +28,9 @@
import org.jboss.weld.injection.FieldInjectionPoint;
import org.jboss.weld.injection.InjectionContextImpl;
import org.jboss.weld.injection.MethodInjectionPoint;
import org.jboss.weld.injection.WBInjectionPoint;
import org.jboss.weld.introspector.WBClass;
import org.jboss.weld.introspector.WBMethod;
import org.jboss.weld.injection.WeldInjectionPoint;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.util.Beans;

/**
Expand All @@ -41,19 +41,19 @@ public class SimpleInjectionTarget<T> implements InjectionTarget<T>
{

private final BeanManagerImpl beanManager;
private final WBClass<T> type;
private final WeldClass<T> type;
private final ConstructorInjectionPoint<T> constructor;
private final List<Set<FieldInjectionPoint<?, ?>>> injectableFields;
private final List<Set<MethodInjectionPoint<?, ?>>> initializerMethods;
private final WBMethod<?, ?> postConstruct;
private final WBMethod<?, ?> preDestroy;
private final WeldMethod<?, ?> postConstruct;
private final WeldMethod<?, ?> preDestroy;
private final Set<InjectionPoint> injectionPoints;
private final Set<WBInjectionPoint<?, ?>> ejbInjectionPoints;
private final Set<WBInjectionPoint<?, ?>> persistenceContextInjectionPoints;
private final Set<WBInjectionPoint<?, ?>> persistenceUnitInjectionPoints;
private final Set<WBInjectionPoint<?, ?>> resourceInjectionPoints;
private final Set<WeldInjectionPoint<?, ?>> ejbInjectionPoints;
private final Set<WeldInjectionPoint<?, ?>> persistenceContextInjectionPoints;
private final Set<WeldInjectionPoint<?, ?>> persistenceUnitInjectionPoints;
private final Set<WeldInjectionPoint<?, ?>> resourceInjectionPoints;

public SimpleInjectionTarget(WBClass<T> type, BeanManagerImpl beanManager)
public SimpleInjectionTarget(WeldClass<T> type, BeanManagerImpl beanManager)
{
this.beanManager = beanManager;
this.type = type;
Expand Down
6 changes: 3 additions & 3 deletions impl/src/main/java/org/jboss/weld/Validator.java
Expand Up @@ -48,9 +48,9 @@
import org.jboss.weld.bean.RIBean;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.bootstrap.api.Service;
import org.jboss.weld.introspector.WBAnnotated;
import org.jboss.weld.introspector.WeldAnnotated;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
import org.jboss.weld.resolution.ResolvableWBClass;
import org.jboss.weld.resolution.ResolvableWeldClass;
import org.jboss.weld.util.Beans;
import org.jboss.weld.util.Proxies;
import org.jboss.weld.util.Reflections;
Expand Down Expand Up @@ -155,7 +155,7 @@ public void validateInjectionPoint(InjectionPoint ij, BeanManagerImpl beanManage
checkFacadeInjectionPoint(ij, Instance.class);
checkFacadeInjectionPoint(ij, Event.class);
Annotation[] bindings = ij.getQualifiers().toArray(new Annotation[0]);
WBAnnotated<?, ?> annotatedItem = ResolvableWBClass.of(ij.getType(), bindings, beanManager);
WeldAnnotated<?, ?> annotatedItem = ResolvableWeldClass.of(ij.getType(), bindings, beanManager);
Set<?> resolvedBeans = beanManager.getBeanResolver().resolve(beanManager.getInjectableBeans(ij));
if (resolvedBeans.isEmpty())
{
Expand Down
34 changes: 17 additions & 17 deletions impl/src/main/java/org/jboss/weld/bean/AbstractBean.java
Expand Up @@ -34,10 +34,10 @@
import org.jboss.weld.Container;
import org.jboss.weld.DefinitionException;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.injection.WBInjectionPoint;
import org.jboss.weld.introspector.WBAnnotated;
import org.jboss.weld.introspector.WBField;
import org.jboss.weld.introspector.WBParameter;
import org.jboss.weld.injection.WeldInjectionPoint;
import org.jboss.weld.introspector.WeldAnnotated;
import org.jboss.weld.introspector.WeldField;
import org.jboss.weld.introspector.WeldParameter;
import org.jboss.weld.literal.AnyLiteral;
import org.jboss.weld.literal.DefaultLiteral;
import org.jboss.weld.log.Log;
Expand Down Expand Up @@ -79,8 +79,8 @@ public abstract class AbstractBean<T, E> extends RIBean<T>
// The API types
protected Set<Type> types;
// The injection points
private Set<WBInjectionPoint<?, ?>> injectionPoints;
private Set<WBInjectionPoint<?, ?>> delegateInjectionPoints;
private Set<WeldInjectionPoint<?, ?>> injectionPoints;
private Set<WeldInjectionPoint<?, ?>> delegateInjectionPoints;
// If the type a primitive?
private boolean primitive;
// The Bean manager
Expand All @@ -106,8 +106,8 @@ public AbstractBean(String idSuffix, BeanManagerImpl manager)
{
super(idSuffix, manager);
this.manager = manager;
this.injectionPoints = new HashSet<WBInjectionPoint<?, ?>>();
this.delegateInjectionPoints = new HashSet<WBInjectionPoint<?,?>>();
this.injectionPoints = new HashSet<WeldInjectionPoint<?, ?>>();
this.delegateInjectionPoints = new HashSet<WeldInjectionPoint<?,?>>();
}

/**
Expand Down Expand Up @@ -145,7 +145,7 @@ protected void checkDelegateInjectionPoints()
}
}

protected void addInjectionPoint(WBInjectionPoint<?, ?> injectionPoint)
protected void addInjectionPoint(WeldInjectionPoint<?, ?> injectionPoint)
{
if (injectionPoint.isAnnotationPresent(Decorates.class))
{
Expand All @@ -154,15 +154,15 @@ protected void addInjectionPoint(WBInjectionPoint<?, ?> injectionPoint)
injectionPoints.add(injectionPoint);
}

protected void addInjectionPoints(Iterable<? extends WBInjectionPoint<?, ?>> injectionPoints)
protected void addInjectionPoints(Iterable<? extends WeldInjectionPoint<?, ?>> injectionPoints)
{
for (WBInjectionPoint<?, ?> injectionPoint : injectionPoints)
for (WeldInjectionPoint<?, ?> injectionPoint : injectionPoints)
{
addInjectionPoint(injectionPoint);
}
}

protected Set<WBInjectionPoint<?, ?>> getDelegateInjectionPoints()
protected Set<WeldInjectionPoint<?, ?>> getDelegateInjectionPoints()
{
return delegateInjectionPoints;
}
Expand Down Expand Up @@ -262,13 +262,13 @@ protected void initPrimitive()
private boolean checkInjectionPointsAreSerializable()
{
boolean passivating = manager.getServices().get(MetaAnnotationStore.class).getScopeModel(this.getScope()).isPassivating();
for (WBInjectionPoint<?, ?> injectionPoint : getAnnotatedInjectionPoints())
for (WeldInjectionPoint<?, ?> injectionPoint : getAnnotatedInjectionPoints())
{
Annotation[] bindings = injectionPoint.getMetaAnnotationsAsArray(Qualifier.class);
Bean<?> resolvedBean = manager.getBeans(injectionPoint.getJavaClass(), bindings).iterator().next();
if (passivating)
{
if (Dependent.class.equals(resolvedBean.getScope()) && !Reflections.isSerializable(resolvedBean.getBeanClass()) && (((injectionPoint instanceof WBField<?, ?>) && !((WBField<?, ?>) injectionPoint).isTransient()) || (injectionPoint instanceof WBParameter<?, ?>)))
if (Dependent.class.equals(resolvedBean.getScope()) && !Reflections.isSerializable(resolvedBean.getBeanClass()) && (((injectionPoint instanceof WeldField<?, ?>) && !((WeldField<?, ?>) injectionPoint).isTransient()) || (injectionPoint instanceof WeldParameter<?, ?>)))
{
return false;
}
Expand Down Expand Up @@ -331,7 +331,7 @@ protected void specialize(BeanDeployerEnvironment environment)
*
* @return The annotated item
*/
protected abstract WBAnnotated<T, E> getAnnotatedItem();
protected abstract WeldAnnotated<T, E> getAnnotatedItem();

/**
* Gets the binding types
Expand All @@ -356,7 +356,7 @@ public Set<Annotation> getQualifiers()
public abstract AbstractBean<?, ?> getSpecializedBean();

@Override
public Set<WBInjectionPoint<?, ?>> getAnnotatedInjectionPoints()
public Set<WeldInjectionPoint<?, ?>> getAnnotatedInjectionPoints()
{
return injectionPoints;
}
Expand Down Expand Up @@ -425,7 +425,7 @@ public Set<Type> getTypes()
* @param annotatedItem The other annotation to check
* @return True if assignable, otherwise false
*/
public boolean isAssignableFrom(WBAnnotated<?, ?> annotatedItem)
public boolean isAssignableFrom(WeldAnnotated<?, ?> annotatedItem)
{
return this.getAnnotatedItem().isAssignableFrom(annotatedItem);
}
Expand Down
30 changes: 15 additions & 15 deletions impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java
Expand Up @@ -44,8 +44,8 @@
import org.jboss.weld.context.SerializableContextualInstance;
import org.jboss.weld.injection.FieldInjectionPoint;
import org.jboss.weld.injection.MethodInjectionPoint;
import org.jboss.weld.introspector.WBClass;
import org.jboss.weld.introspector.WBMethod;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.log.LogProvider;
import org.jboss.weld.log.Logging;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
Expand All @@ -69,7 +69,7 @@ public abstract class AbstractClassBean<T> extends AbstractBean<T, Class<T>> imp
// Logger
private static final LogProvider log = Logging.getLogProvider(AbstractClassBean.class);
// The item representation
protected WBClass<T> annotatedItem;
protected WeldClass<T> annotatedItem;
// The injectable fields of each type in the type hierarchy, with the actual type at the bottom
private List<Set<FieldInjectionPoint<?, ?>>> injectableFields;
// The initializer methods of each type in the type hierarchy, with the actual type at the bottom
Expand All @@ -81,16 +81,16 @@ public abstract class AbstractClassBean<T> extends AbstractBean<T, Class<T>> imp
private Class<T> proxyClassForDecorators;

private final ThreadLocal<Integer> decoratorStackPosition;
private WBMethod<?, ?> postConstruct;
private WBMethod<?, ?> preDestroy;
private WeldMethod<?, ?> postConstruct;
private WeldMethod<?, ?> preDestroy;

/**
* Constructor
*
* @param type The type
* @param manager The Bean manager
*/
protected AbstractClassBean(WBClass<T> type, String idSuffix, BeanManagerImpl manager)
protected AbstractClassBean(WeldClass<T> type, String idSuffix, BeanManagerImpl manager)
{
super(idSuffix, manager);
this.annotatedItem = type;
Expand Down Expand Up @@ -251,7 +251,7 @@ protected void initInitializerMethods()
@Override
protected void initScopeType()
{
for (WBClass<?> clazz = getAnnotatedItem(); clazz != null; clazz = clazz.getWBSuperclass())
for (WeldClass<?> clazz = getAnnotatedItem(); clazz != null; clazz = clazz.getWeldSuperclass())
{
Set<Annotation> scopeTypes = new HashSet<Annotation>();
scopeTypes.addAll(clazz.getDeclaredMetaAnnotations(Scope.class));
Expand Down Expand Up @@ -292,7 +292,7 @@ protected void checkBeanImplementation() {}
protected void preSpecialize(BeanDeployerEnvironment environment)
{
super.preSpecialize(environment);
if (getAnnotatedItem().getWBSuperclass() == null || getAnnotatedItem().getWBSuperclass().getJavaClass().equals(Object.class))
if (getAnnotatedItem().getWeldSuperclass() == null || getAnnotatedItem().getWeldSuperclass().getJavaClass().equals(Object.class))
{
throw new DefinitionException("Specializing bean must extend another bean " + toString());
}
Expand All @@ -304,7 +304,7 @@ protected void preSpecialize(BeanDeployerEnvironment environment)
* @return The annotated item
*/
@Override
public WBClass<T> getAnnotatedItem()
public WeldClass<T> getAnnotatedItem()
{
return annotatedItem;
}
Expand Down Expand Up @@ -350,7 +350,7 @@ public Set<String> getSuperclasses()

public void postConstruct(T instance)
{
WBMethod<?, ?> postConstruct = getPostConstruct();
WeldMethod<?, ?> postConstruct = getPostConstruct();
if (postConstruct != null)
{
try
Expand All @@ -366,7 +366,7 @@ public void postConstruct(T instance)

public void preDestroy(T instance)
{
WBMethod<?, ?> preDestroy = getPreDestroy();
WeldMethod<?, ?> preDestroy = getPreDestroy();
if (preDestroy != null)
{
try
Expand Down Expand Up @@ -402,7 +402,7 @@ protected void initPreDestroy()
*
* @return The post-construct method
*/
public WBMethod<?, ?> getPostConstruct()
public WeldMethod<?, ?> getPostConstruct()
{
return postConstruct;
}
Expand All @@ -412,7 +412,7 @@ protected void initPreDestroy()
*
* @return The pre-destroy method
*/
public WBMethod<?, ?> getPreDestroy()
public WeldMethod<?, ?> getPreDestroy()
{
return preDestroy;
}
Expand Down Expand Up @@ -455,8 +455,8 @@ protected void initInterceptors()
builder.interceptPostConstruct().with(manager.resolveInterceptors(InterceptionType.POST_CONSTRUCT, classBindingAnnotations.toArray(new Annotation[0])).toArray(new Interceptor<?>[]{}));
builder.interceptPreDestroy().with(manager.resolveInterceptors(InterceptionType.PRE_DESTROY, classBindingAnnotations.toArray(new Annotation[0])).toArray(new Interceptor<?>[]{}));

List<WBMethod<?, ?>> businessMethods = Beans.getInterceptableBusinessMethods(getAnnotatedItem());
for (WBMethod<?, ?> method : businessMethods)
List<WeldMethod<?, ?>> businessMethods = Beans.getInterceptableBusinessMethods(getAnnotatedItem());
for (WeldMethod<?, ?> method : businessMethods)
{
List<Annotation> methodBindingAnnotations = new ArrayList<Annotation>(classBindingAnnotations);
methodBindingAnnotations.addAll(flattenInterceptorBindings(manager, method.getAnnotations()));
Expand Down
Expand Up @@ -40,7 +40,7 @@
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.DefinitionException;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.introspector.WBMember;
import org.jboss.weld.introspector.WeldMember;
import org.jboss.weld.log.LogProvider;
import org.jboss.weld.log.Logging;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
Expand Down Expand Up @@ -71,7 +71,7 @@ public AbstractProducerBean(String idSuffix, AbstractClassBean<X> declaringBean,
}

@Override
public abstract WBMember<T, X, S> getAnnotatedItem();
public abstract WeldMember<T, X, S> getAnnotatedItem();

@Override
// Overriden to provide the class of the bean that declares the producer method/field
Expand Down

0 comments on commit d6a4540

Please sign in to comment.