Weld SVN: r5439 - in core/trunk/impl/src/main/java/org/jboss/weld/bean: builtin and 1 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-01-12 07:58:27 -0500 (Tue, 12 Jan 2010)
New Revision: 5439
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/NewManagedBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/NewSessionBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/RIBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractBuiltInBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractFacadeBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/BeanManagerBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/CallableMethodHandler.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/EventBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ExtensionBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/FacadeBeanResolvableTransformer.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InjectionPointBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/EEResourceProducerField.java
Log:
tidy up
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractBean.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractBean.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -86,12 +86,12 @@
/**
* Constructor
*
- * @param manager The Bean manager
+ * @param beanManager The Bean manager
*/
- public AbstractBean(String idSuffix, BeanManagerImpl manager)
+ public AbstractBean(String idSuffix, BeanManagerImpl beanManager)
{
- super(idSuffix, manager);
- this.beanManager = manager;
+ super(idSuffix, beanManager);
+ this.beanManager = beanManager;
this.injectionPoints = new HashSet<WeldInjectionPoint<?, ?>>();
this.delegateInjectionPoints = new HashSet<WeldInjectionPoint<?,?>>();
this.newInjectionPoints = new HashSet<WeldInjectionPoint<?,?>>();
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -94,19 +94,19 @@
* Extracts the complete set of interception bindings from a given set of
* annotations.
*
- * @param manager
+ * @param beanManager
* @param annotations
* @return
*/
- protected static Set<Annotation> flattenInterceptorBindings(BeanManagerImpl manager, Set<Annotation> annotations)
+ protected static Set<Annotation> flattenInterceptorBindings(BeanManagerImpl beanManager, Set<Annotation> annotations)
{
Set<Annotation> foundInterceptionBindingTypes = new HashSet<Annotation>();
for (Annotation annotation : annotations)
{
- if (manager.isInterceptorBinding(annotation.annotationType()))
+ if (beanManager.isInterceptorBinding(annotation.annotationType()))
{
foundInterceptionBindingTypes.add(annotation);
- foundInterceptionBindingTypes.addAll(manager.getServices().get(MetaAnnotationStore.class).getInterceptorBindingModel(annotation.annotationType()).getInheritedInterceptionBindingTypes());
+ foundInterceptionBindingTypes.addAll(beanManager.getServices().get(MetaAnnotationStore.class).getInterceptorBindingModel(annotation.annotationType()).getInheritedInterceptionBindingTypes());
}
}
return foundInterceptionBindingTypes;
@@ -158,11 +158,11 @@
* Constructor
*
* @param type The type
- * @param manager The Bean manager
+ * @param beanManager The Bean manager
*/
- protected AbstractClassBean(WeldClass<T> type, String idSuffix, BeanManagerImpl manager)
+ protected AbstractClassBean(WeldClass<T> type, String idSuffix, BeanManagerImpl beanManager)
{
- super(idSuffix, manager);
+ super(idSuffix, beanManager);
this.annotatedItem = type;
this.decoratorStackPosition = new ThreadLocal<Integer>()
{
@@ -214,7 +214,7 @@
public void initDecorators()
{
- this.decorators = getManager().resolveDecorators(getTypes(), getQualifiers());
+ this.decorators = getBeanManager().resolveDecorators(getTypes(), getQualifiers());
}
public boolean hasDecorators()
@@ -245,7 +245,7 @@
Decorator<?> decorator = decorators.get(i);
decoratorStackPosition.set(++i);
- Object decoratorInstance = getManager().getReference(ip, decorator, creationalContext);
+ Object decoratorInstance = getBeanManager().getReference(ip, decorator, creationalContext);
decoratorInstances.add(new SerializableContextualInstanceImpl<Decorator<Object>, Object>((Decorator<Object>) decorator, decoratorInstance, null));
ip = Beans.getDelegateInjectionPoint(decorator);
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -96,11 +96,11 @@
* Constructor
*
* @param declaringBean The declaring bean
- * @param manager The Bean manager
+ * @param beanManager The Bean manager
*/
- public AbstractProducerBean(String idSuffix, AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
+ public AbstractProducerBean(String idSuffix, AbstractClassBean<X> declaringBean, BeanManagerImpl beanManager)
{
- super(idSuffix, declaringBean, manager);
+ super(idSuffix, declaringBean, beanManager);
serializationCheckCache = new ConcurrentCache<Class<?>, Boolean>();
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -42,9 +42,9 @@
private AbstractClassBean<X> declaringBean;
- public AbstractReceiverBean(String idSuffix, AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
+ public AbstractReceiverBean(String idSuffix, AbstractClassBean<X> declaringBean, BeanManagerImpl beanManager)
{
- super(idSuffix, manager);
+ super(idSuffix, beanManager);
this.declaringBean = declaringBean;
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -58,13 +58,8 @@
public class DecoratorImpl<T> extends ManagedBean<T> implements WeldDecorator<T>
{
- private WeldClass<?> annotatedDelegateItem;
+
- private WeldClass<T> proxyClassForAbstractDecorators;
- private WeldConstructor<T> constructorForAbstractDecorator;
-
- private Set<MethodSignature> decoratedMethodSignatures;
-
public static <T> Decorator<T> wrap(final Decorator<T> decorator)
{
return new ForwardingDecorator<T>()
@@ -96,24 +91,27 @@
*
* @param <T> The type
* @param clazz The class
- * @param manager the current manager
+ * @param beanManager the current manager
* @return a Bean
*/
- public static <T> DecoratorImpl<T> of(WeldClass<T> clazz, BeanManagerImpl manager)
+ public static <T> DecoratorImpl<T> of(WeldClass<T> clazz, BeanManagerImpl beanManager)
{
- return new DecoratorImpl<T>(clazz, manager);
+ return new DecoratorImpl<T>(clazz, beanManager);
}
-
+
+ private WeldClass<?> annotatedDelegateItem;
+ private WeldClass<T> proxyClassForAbstractDecorators;
+ private WeldConstructor<T> constructorForAbstractDecorator;
+ private Set<MethodSignature> decoratedMethodSignatures;
private WeldInjectionPoint<?, ?> delegateInjectionPoint;
private Set<Annotation> delegateBindings;
private Type delegateType;
private Set<Type> delegateTypes;
private Set<Type> decoratedTypes;
- private HashSet<WeldClass<?>> annotatedDecoratedTypes;
- protected DecoratorImpl(WeldClass<T> type, BeanManagerImpl manager)
+ protected DecoratorImpl(WeldClass<T> type, BeanManagerImpl beanManager)
{
- super(type, new StringBuilder().append(Decorator.class.getSimpleName()).append(BEAN_ID_SEPARATOR).append(type.getName()).toString(), manager);
+ super(type, new StringBuilder().append(Decorator.class.getSimpleName()).append(BEAN_ID_SEPARATOR).append(type.getName()).toString(), beanManager);
}
@Override
@@ -137,7 +135,7 @@
this.decoratedTypes.addAll(getWeldAnnotated().getInterfaceClosure());
this.decoratedTypes.remove(Serializable.class);
- this.decoratedMethodSignatures = Deployers.getDecoratedMethodSignatures(getManager(), this.decoratedTypes);
+ this.decoratedMethodSignatures = Deployers.getDecoratedMethodSignatures(getBeanManager(), this.decoratedTypes);
}
protected void initDelegateInjectionPoint()
@@ -216,7 +214,7 @@
{
for(WeldMethod<?,?> method: getWeldAnnotated().getWeldMethods())
{
- if (Reflections.isAbstract(((AnnotatedMethod) method).getJavaMember()))
+ if (Reflections.isAbstract(((AnnotatedMethod<?>) method).getJavaMember()))
{
MethodSignature methodSignature = method.getSignature();
if (this.annotatedDelegateItem.getWeldMethod(methodSignature) == null)
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -47,12 +47,11 @@
{
protected MethodInjectionPoint<T, X> disposalMethodInjectionPoint;
-
private WeldParameter<?, X> disposesParameter;
- protected DisposalMethod(BeanManagerImpl manager, WeldMethod<T, X> disposalMethod, AbstractClassBean<X> declaringBean)
+ protected DisposalMethod(BeanManagerImpl beanManager, WeldMethod<T, X> disposalMethod, AbstractClassBean<X> declaringBean)
{
- super(new StringBuilder().append(DisposalMethod.class.getSimpleName()).append(BEAN_ID_SEPARATOR).append(declaringBean.getWeldAnnotated().getName()).append(disposalMethod.getSignature().toString()).toString(), declaringBean, manager);
+ super(new StringBuilder().append(DisposalMethod.class.getSimpleName()).append(BEAN_ID_SEPARATOR).append(declaringBean.getWeldAnnotated().getName()).append(disposalMethod.getSignature().toString()).toString(), declaringBean, beanManager);
this.disposalMethodInjectionPoint = MethodInjectionPoint.of(this, disposalMethod);
initQualifiers();
initType();
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -48,33 +48,33 @@
private final Set<Annotation> interceptorBindingTypes;
private final boolean serializable;
+
+ public static <T> InterceptorImpl<T> of(WeldClass<T> type, BeanManagerImpl beanManager)
+ {
+ return new InterceptorImpl<T>(type, beanManager);
+ }
- protected InterceptorImpl(WeldClass<T> type, BeanManagerImpl manager)
+ protected InterceptorImpl(WeldClass<T> type, BeanManagerImpl beanManager)
{
- super(type, new StringBuilder().append(Interceptor.class.getSimpleName()).append(BEAN_ID_SEPARATOR).append(type.getName()).toString(), manager);
+ super(type, new StringBuilder().append(Interceptor.class.getSimpleName()).append(BEAN_ID_SEPARATOR).append(type.getName()).toString(), beanManager);
this.interceptorClassMetadata = InterceptorClassMetadataRegistry.getRegistry().getInterceptorClassMetadata(type.getJavaClass());
this.serializable = type.isSerializable();
this.interceptorBindingTypes = new HashSet<Annotation>();
- interceptorBindingTypes.addAll(flattenInterceptorBindings(manager, getWeldAnnotated().getAnnotations()));
+ interceptorBindingTypes.addAll(flattenInterceptorBindings(beanManager, getWeldAnnotated().getAnnotations()));
for (Class<? extends Annotation> annotation : getStereotypes())
{
- interceptorBindingTypes.addAll(flattenInterceptorBindings(manager, manager.getStereotypeDefinition(annotation)));
+ interceptorBindingTypes.addAll(flattenInterceptorBindings(beanManager, beanManager.getStereotypeDefinition(annotation)));
}
if (this.interceptorBindingTypes.size() == 0)
{
throw new DeploymentException(MISSING_BINDING_ON_INTERCEPTOR, type.getName());
}
- if (Beans.findInterceptorBindingConflicts(manager, interceptorBindingTypes))
+ if (Beans.findInterceptorBindingConflicts(beanManager, interceptorBindingTypes))
{
throw new DeploymentException(CONFLICTING_INTERCEPTOR_BINDINGS, getType());
}
}
- public static <T> InterceptorImpl<T> of(WeldClass<T> type, BeanManagerImpl manager)
- {
- return new InterceptorImpl<T>(type, manager);
- }
-
public Set<Annotation> getInterceptorBindings()
{
return interceptorBindingTypes;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -95,12 +95,12 @@
*
* @param <T> The type
* @param clazz The class
- * @param manager the current manager
+ * @param beanManager the current manager
* @return A Web Bean
*/
- public static <T> ManagedBean<T> of(WeldClass<T> clazz, BeanManagerImpl manager)
+ public static <T> ManagedBean<T> of(WeldClass<T> clazz, BeanManagerImpl beanManager)
{
- return new ManagedBean<T>(clazz, createId(ManagedBean.class.getSimpleName(), clazz), manager);
+ return new ManagedBean<T>(clazz, createId(ManagedBean.class.getSimpleName(), clazz), beanManager);
}
protected static String createId(String beanType, WeldClass<?> clazz)
@@ -112,11 +112,11 @@
* Constructor
*
* @param type The type of the bean
- * @param manager The Bean manager
+ * @param beanManager The Bean manager
*/
- protected ManagedBean(WeldClass<T> type, String idSuffix, BeanManagerImpl manager)
+ protected ManagedBean(WeldClass<T> type, String idSuffix, BeanManagerImpl beanManager)
{
- super(type, idSuffix, manager);
+ super(type, idSuffix, beanManager);
initType();
initTypes();
initQualifiers();
@@ -144,7 +144,7 @@
{
throw new ForbiddenStateException(DELEGATE_INJECTION_POINT_NOT_FOUND, decorator);
}
- return getManager().replaceOrPushCurrentInjectionPoint(outerDelegateInjectionPoint);
+ return getBeanManager().replaceOrPushCurrentInjectionPoint(outerDelegateInjectionPoint);
}
/**
@@ -189,13 +189,13 @@
public void inject(final T instance, final CreationalContext<T> ctx)
{
- new InjectionContextImpl<T>(getManager(), this, instance)
+ new InjectionContextImpl<T>(getBeanManager(), this, instance)
{
public void proceed()
{
- Beans.injectEEFields(instance, getManager(), ejbInjectionPoints, persistenceContextInjectionPoints, persistenceUnitInjectionPoints, resourceInjectionPoints);
- Beans.injectFieldsAndInitializers(instance, ctx, getManager(), getInjectableFields(), getInitializerMethods());
+ Beans.injectEEFields(instance, getBeanManager(), ejbInjectionPoints, persistenceContextInjectionPoints, persistenceUnitInjectionPoints, resourceInjectionPoints);
+ Beans.injectFieldsAndInitializers(instance, ctx, getBeanManager(), getInjectableFields(), getInitializerMethods());
}
}.run();
@@ -285,7 +285,7 @@
}
if (this.passivationCapableBean && hasCdiBoundInterceptors())
{
- for (SerializableContextual<Interceptor<?>, ?> interceptor : getManager().getCdiInterceptorsRegistry().getInterceptionModel(getType()).getAllInterceptors())
+ for (SerializableContextual<Interceptor<?>, ?> interceptor : getBeanManager().getCdiInterceptorsRegistry().getInterceptionModel(getType()).getAllInterceptors())
{
if (!(PassivationCapable.class.isAssignableFrom(interceptor.get().getClass())) || !((InterceptorImpl<?>)interceptor.get()).isSerializable())
{
@@ -296,7 +296,7 @@
}
if (this.passivationCapableBean && hasDirectlyDefinedInterceptors())
{
- for (Class<?> interceptorClass : getManager().getClassDeclaredInterceptorsRegistry().getInterceptionModel(getType()).getAllInterceptors())
+ for (Class<?> interceptorClass : getBeanManager().getClassDeclaredInterceptorsRegistry().getInterceptionModel(getType()).getAllInterceptors())
{
if (!Reflections.isSerializable(interceptorClass))
{
@@ -338,9 +338,9 @@
private void initEEInjectionPoints()
{
- this.ejbInjectionPoints = Beans.getEjbInjectionPoints(this, getWeldAnnotated(), getManager());
- this.persistenceContextInjectionPoints = Beans.getPersistenceContextInjectionPoints(this, getWeldAnnotated(), getManager());
- this.persistenceUnitInjectionPoints = Beans.getPersistenceUnitInjectionPoints(this, getWeldAnnotated(), getManager());
+ this.ejbInjectionPoints = Beans.getEjbInjectionPoints(this, getWeldAnnotated(), getBeanManager());
+ this.persistenceContextInjectionPoints = Beans.getPersistenceContextInjectionPoints(this, getWeldAnnotated(), getBeanManager());
+ this.persistenceUnitInjectionPoints = Beans.getPersistenceUnitInjectionPoints(this, getWeldAnnotated(), getBeanManager());
this.resourceInjectionPoints = Beans.getResourceInjectionPoints(this, getWeldAnnotated(), beanManager);
}
@@ -465,7 +465,7 @@
if (hasDirectlyDefinedInterceptors())
{
interceptionRegistries.add(beanManager.getClassDeclaredInterceptorsRegistry());
- interceptionHandlerFactories.add(new ClassInterceptionHandlerFactory(creationalContext, getManager()));
+ interceptionHandlerFactories.add(new ClassInterceptionHandlerFactory(creationalContext, getBeanManager()));
}
if (hasCdiBoundInterceptors())
{
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/NewManagedBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/NewManagedBean.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/NewManagedBean.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -38,12 +38,12 @@
* Creates an instance of a NewSimpleBean from an annotated class
*
* @param clazz The annotated class
- * @param manager The Bean manager
+ * @param beanManager The Bean manager
* @return a new NewSimpleBean instance
*/
- public static <T> NewManagedBean<T> of(WeldClass<T> clazz, BeanManagerImpl manager)
+ public static <T> NewManagedBean<T> of(WeldClass<T> clazz, BeanManagerImpl beanManager)
{
- return new NewManagedBean<T>(clazz, createId(NewManagedBean.class.getSimpleName(), clazz), manager);
+ return new NewManagedBean<T>(clazz, createId(NewManagedBean.class.getSimpleName(), clazz), beanManager);
}
private Set<Annotation> bindings;
@@ -52,11 +52,11 @@
* Protected constructor
*
* @param type An annotated class
- * @param manager The Bean manager
+ * @param beanManager The Bean manager
*/
- protected NewManagedBean(final WeldClass<T> type, String idSuffix, BeanManagerImpl manager)
+ protected NewManagedBean(final WeldClass<T> type, String idSuffix, BeanManagerImpl beanManager)
{
- super(type, idSuffix, manager);
+ super(type, idSuffix, beanManager);
this.bindings = new HashSet<Annotation>();
this.bindings.add(new NewLiteral()
{
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/NewSessionBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/NewSessionBean.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/NewSessionBean.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -40,13 +40,13 @@
* Creates an instance of a NewEnterpriseBean from an annotated class
*
* @param clazz The annotated class
- * @param manager The Bean manager
+ * @param beanManager The Bean manager
* @return a new NewEnterpriseBean instance
*/
- public static <T> NewSessionBean<T> of(InternalEjbDescriptor<T> ejbDescriptor, BeanManagerImpl manager)
+ public static <T> NewSessionBean<T> of(InternalEjbDescriptor<T> ejbDescriptor, BeanManagerImpl beanManager)
{
- WeldClass<T> type = manager.getServices().get(ClassTransformer.class).loadClass(ejbDescriptor.getBeanClass());
- return new NewSessionBean<T>(type, ejbDescriptor, createId(NewSessionBean.class.getSimpleName(), ejbDescriptor), manager);
+ WeldClass<T> type = beanManager.getServices().get(ClassTransformer.class).loadClass(ejbDescriptor.getBeanClass());
+ return new NewSessionBean<T>(type, ejbDescriptor, createId(NewSessionBean.class.getSimpleName(), ejbDescriptor), beanManager);
}
private Set<Annotation> bindings;
@@ -55,11 +55,11 @@
* Protected constructor
*
* @param type An annotated class
- * @param manager The Bean manager
+ * @param beanManager The Bean manager
*/
- protected NewSessionBean(final WeldClass<T> type, InternalEjbDescriptor<T> ejbDescriptor, String idSuffix, BeanManagerImpl manager)
+ protected NewSessionBean(final WeldClass<T> type, InternalEjbDescriptor<T> ejbDescriptor, String idSuffix, BeanManagerImpl beanManager)
{
- super(type, ejbDescriptor, idSuffix, manager);
+ super(type, ejbDescriptor, idSuffix, beanManager);
this.bindings = new HashSet<Annotation>();
this.bindings.add(new NewLiteral()
{
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -47,12 +47,12 @@
*
* @param field The underlying method abstraction
* @param declaringBean The declaring bean abstraction
- * @param manager the current manager
+ * @param beanManager the current manager
* @return A producer field
*/
- public static <X, T> ProducerField<X, T> of(WeldField<T, X> field, AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
+ public static <X, T> ProducerField<X, T> of(WeldField<T, X> field, AbstractClassBean<X> declaringBean, BeanManagerImpl beanManager)
{
- return new ProducerField<X, T>(field, declaringBean, manager);
+ return new ProducerField<X, T>(field, declaringBean, beanManager);
}
/**
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -64,17 +64,17 @@
*
* @param method The underlying method abstraction
* @param declaringBean The declaring bean abstraction
- * @param manager the current manager
+ * @param beanManager the current manager
* @return A producer Web Bean
*/
- public static <X, T> ProducerMethod<X, T> of(WeldMethod<T, X> method, AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
+ public static <X, T> ProducerMethod<X, T> of(WeldMethod<T, X> method, AbstractClassBean<X> declaringBean, BeanManagerImpl beanManager)
{
- return new ProducerMethod<X, T>(method, declaringBean, manager);
+ return new ProducerMethod<X, T>(method, declaringBean, beanManager);
}
- protected ProducerMethod(WeldMethod<T, X> method, AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
+ protected ProducerMethod(WeldMethod<T, X> method, AbstractClassBean<X> declaringBean, BeanManagerImpl beanManager)
{
- super(new StringBuilder().append(ProducerMethod.class.getSimpleName()).append(BEAN_ID_SEPARATOR).append(declaringBean.getWeldAnnotated().getName()).append(".").append(method.getSignature().toString()).toString(), declaringBean, manager);
+ super(new StringBuilder().append(ProducerMethod.class.getSimpleName()).append(BEAN_ID_SEPARATOR).append(declaringBean.getWeldAnnotated().getName()).append(".").append(method.getSignature().toString()).toString(), declaringBean, beanManager);
this.method = MethodInjectionPoint.of(this, method);
initType();
initTypes();
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/RIBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/RIBean.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/RIBean.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -39,19 +39,19 @@
public static final String BEAN_ID_SEPARATOR = "-";
- private final BeanManagerImpl manager;
+ private final BeanManagerImpl beanManager;
private final String id;
- protected RIBean(String idSuffix, BeanManagerImpl manager)
+ protected RIBean(String idSuffix, BeanManagerImpl beanManager)
{
- this.manager = manager;
- this.id = new StringBuilder().append(BEAN_ID_PREFIX).append(BEAN_ID_SEPARATOR).append(manager.getId()).append(BEAN_ID_SEPARATOR).append(idSuffix).toString();
+ this.beanManager = beanManager;
+ this.id = new StringBuilder().append(BEAN_ID_PREFIX).append(BEAN_ID_SEPARATOR).append(beanManager.getId()).append(BEAN_ID_SEPARATOR).append(idSuffix).toString();
}
- protected BeanManagerImpl getManager()
+ protected BeanManagerImpl getBeanManager()
{
- return manager;
+ return beanManager;
}
public abstract Class<T> getType();
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -98,13 +98,13 @@
*
* @param <T> The type
* @param clazz The class
- * @param manager the current manager
+ * @param beanManager the current manager
* @return An Enterprise Web Bean
*/
- public static <T> SessionBean<T> of(InternalEjbDescriptor<T> ejbDescriptor, BeanManagerImpl manager)
+ public static <T> SessionBean<T> of(InternalEjbDescriptor<T> ejbDescriptor, BeanManagerImpl beanManager)
{
- WeldClass<T> type = manager.getServices().get(ClassTransformer.class).loadClass(ejbDescriptor.getBeanClass());
- return new SessionBean<T>(type, ejbDescriptor, createId(SessionBean.class.getSimpleName(), ejbDescriptor) , manager);
+ WeldClass<T> type = beanManager.getServices().get(ClassTransformer.class).loadClass(ejbDescriptor.getBeanClass());
+ return new SessionBean<T>(type, ejbDescriptor, createId(SessionBean.class.getSimpleName(), ejbDescriptor) , beanManager);
}
protected static String createId(String beanType, InternalEjbDescriptor<?> ejbDescriptor)
@@ -149,12 +149,12 @@
public void inject(final T instance, final CreationalContext<T> ctx)
{
- new InjectionContextImpl<T>(getManager(), this, instance)
+ new InjectionContextImpl<T>(getBeanManager(), this, instance)
{
public void proceed()
{
- Beans.injectFieldsAndInitializers(instance, ctx, getManager(), getInjectableFields(), getInitializerMethods());
+ Beans.injectFieldsAndInitializers(instance, ctx, getBeanManager(), getInjectableFields(), getInitializerMethods());
}
}.run();
@@ -428,7 +428,7 @@
InterceptionModel<Class<?>, SerializableContextual<javax.enterprise.inject.spi.Interceptor<?>, ?>> model = beanManager.getCdiInterceptorsRegistry().getInterceptionModel(ejbDescriptor.getBeanClass());
if (model != null)
{
- getManager().getServices().get(EjbServices.class).registerInterceptors(getEjbDescriptor().delegate(), new InterceptorBindingsAdapter(model));
+ getBeanManager().getServices().get(EjbServices.class).registerInterceptors(getEjbDescriptor().delegate(), new InterceptorBindingsAdapter(model));
}
}
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractBuiltInBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractBuiltInBean.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractBuiltInBean.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -36,9 +36,9 @@
private static final String ID_PREFIX = "Built-in";
private static final Set<Annotation> DEFAULT_QUALIFIERS = Arrays2.asSet( DefaultLiteral.INSTANCE, AnyLiteral.INSTANCE );
- protected AbstractBuiltInBean(String idSuffix, BeanManagerImpl manager)
+ protected AbstractBuiltInBean(String idSuffix, BeanManagerImpl beanManager)
{
- super(new StringBuilder().append(ID_PREFIX).append(BEAN_ID_SEPARATOR).append(idSuffix).toString(), manager);
+ super(new StringBuilder().append(ID_PREFIX).append(BEAN_ID_SEPARATOR).append(idSuffix).toString(), beanManager);
}
@Override
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractFacadeBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractFacadeBean.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractFacadeBean.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -38,7 +38,7 @@
public T create(CreationalContext<T> creationalContext)
{
- InjectionPoint injectionPoint = this.getManager().getCurrentInjectionPoint();
+ InjectionPoint injectionPoint = this.getBeanManager().getCurrentInjectionPoint();
if (injectionPoint != null)
{
return newInstance(injectionPoint);
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/BeanManagerBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/BeanManagerBean.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/BeanManagerBean.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -28,7 +28,7 @@
public class BeanManagerBean extends AbstractBuiltInBean<BeanManagerImpl>
{
- private static final Set<Type> TYPES = Arrays2.<Type>asSet(Object.class, BeanManagerImpl.class, BeanManager.class);
+ private static final Set<Type> TYPES = Arrays2.<Type>asSet( Object.class, BeanManagerImpl.class, BeanManager.class );
public BeanManagerBean(BeanManagerImpl manager)
{
@@ -37,7 +37,7 @@
public BeanManagerImpl create(CreationalContext<BeanManagerImpl> creationalContext)
{
- return getManager().getCurrent();
+ return getBeanManager().getCurrent();
}
@Override
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/CallableMethodHandler.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/CallableMethodHandler.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/CallableMethodHandler.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -23,7 +23,7 @@
private static final LocLogger log = loggerFactory().getLogger(BEAN);
// Can't make this final, need to deallocate on shutdown
- private Callable<?> callable;
+ private final Callable<?> callable;
public CallableMethodHandler(Callable<?> callable)
{
@@ -62,10 +62,5 @@
}
}
}
-
- private void cleanup()
- {
- this.callable = null;
- }
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/EventBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/EventBean.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/EventBean.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -33,6 +33,7 @@
public class EventBean extends AbstractFacadeBean<Event<?>>
{
+ @SuppressWarnings("serial")
private static final Class<Event<?>> TYPE = new TypeLiteral<Event<?>>() {}.getRawType();
private static final Set<Type> DEFAULT_TYPES = Arrays2.<Type>asSet(TYPE, Object.class);
private static final Set<Annotation> DEFAULT_QUALIFIERS = Collections.<Annotation>singleton(AnyLiteral.INSTANCE);
@@ -69,7 +70,7 @@
@Override
protected Event<?> newInstance(InjectionPoint injectionPoint)
{
- return EventImpl.of(injectionPoint, getManager());
+ return EventImpl.of(injectionPoint, getBeanManager());
}
@Override
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ExtensionBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ExtensionBean.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ExtensionBean.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -31,7 +31,6 @@
* @author pmuir
*
*/
-// TODO Move out of built in
public class ExtensionBean extends AbstractBuiltInBean<Extension>
{
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/FacadeBeanResolvableTransformer.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/FacadeBeanResolvableTransformer.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/FacadeBeanResolvableTransformer.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -38,7 +38,7 @@
public class FacadeBeanResolvableTransformer implements ResolvableTransformer
{
- private static final Set<Annotation> DEFAULT_QUALIFIERS = Collections.<Annotation>singleton(AnyLiteral.INSTANCE);
+ private static final Set<Annotation> DEFAULT_QUALIFIERS = Collections.<Annotation>singleton( AnyLiteral.INSTANCE );
private final Class<?> clazz;
private final HashSet<Type> types;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InjectionPointBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InjectionPointBean.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InjectionPointBean.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -34,7 +34,7 @@
public class InjectionPointBean extends AbstractBuiltInBean<InjectionPoint>
{
- private static final Set<Type> TYPES = Arrays2.<Type>asSet(InjectionPoint.class, Object.class);
+ private static final Set<Type> TYPES = Arrays2.<Type>asSet( InjectionPoint.class, Object.class );
/**
* Creates an InjectionPoint Web Bean for the injection of the containing bean owning
@@ -52,7 +52,7 @@
public InjectionPoint create(CreationalContext<InjectionPoint> creationalContext)
{
- return getManager().getCurrentInjectionPoint();
+ return getBeanManager().getCurrentInjectionPoint();
}
public void destroy(InjectionPoint instance, CreationalContext<InjectionPoint> creationalContext)
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceBean.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceBean.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -32,9 +32,11 @@
public class InstanceBean extends AbstractFacadeBean<Instance<?>>
{
+ @SuppressWarnings("serial")
private static final Class<Instance<?>> INSTANCE_TYPE = new TypeLiteral<Instance<?>>() {}.getRawType();
+ @SuppressWarnings("serial")
private static final Class<Provider<?>> PROVIDER_TYPE = new TypeLiteral<Provider<?>>() {}.getRawType();
- private static final Set<Type> DEFAULT_TYPES = Arrays2.<Type>asSet(INSTANCE_TYPE, PROVIDER_TYPE, Object.class);
+ private static final Set<Type> DEFAULT_TYPES = Arrays2.<Type>asSet( INSTANCE_TYPE, PROVIDER_TYPE, Object.class );
private static final Set<Annotation> DEFAULT_QUALIFIERS = Collections.<Annotation>singleton(AnyLiteral.INSTANCE);
public InstanceBean(BeanManagerImpl manager)
@@ -68,7 +70,7 @@
@Override
protected Instance<?> newInstance(InjectionPoint injectionPoint)
{
- return InstanceImpl.of(injectionPoint, getManager());
+ return InstanceImpl.of(injectionPoint, getBeanManager());
}
@Override
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/EEResourceProducerField.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/EEResourceProducerField.java 2010-01-12 12:56:52 UTC (rev 5438)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/EEResourceProducerField.java 2010-01-12 12:58:27 UTC (rev 5439)
@@ -145,7 +145,7 @@
}
else
{
- return Proxies.<T>createProxy(new CallableMethodHandler(new EEResourceCallable<T>(getManager(), this, creationalContext)), TypeInfo.of(getTypes()).add(Serializable.class));
+ return Proxies.<T>createProxy(new CallableMethodHandler(new EEResourceCallable<T>(getBeanManager(), this, creationalContext)), TypeInfo.of(getTypes()).add(Serializable.class));
}
}
catch (InstantiationException e)
15 years
Weld SVN: r5438 - core/trunk/tests/src/test/java/org/jboss/weld/tests/serialization.
by weld-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-01-12 07:56:52 -0500 (Tue, 12 Jan 2010)
New Revision: 5438
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/serialization/SerializationTest.java
Log:
updated test
Modified: core/trunk/tests/src/test/java/org/jboss/weld/tests/serialization/SerializationTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/serialization/SerializationTest.java 2010-01-12 12:40:51 UTC (rev 5437)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/serialization/SerializationTest.java 2010-01-12 12:56:52 UTC (rev 5438)
@@ -5,10 +5,12 @@
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import java.lang.reflect.Field;
import javax.enterprise.inject.spi.Bean;
import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.weld.conversation.AbstractConversationManager;
import org.jboss.weld.conversation.ConversationManager;
import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@@ -19,13 +21,17 @@
@SuppressWarnings("unchecked")
@Test(description="WELD-363")
public void testConversationManagerSerializable()
- throws IOException, ClassNotFoundException
+ throws IOException, ClassNotFoundException, SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException
{
Bean<ConversationManager> cmBean = (Bean<ConversationManager>) getCurrentManager()
.getBeans(ConversationManager.class).iterator().next();
ConversationManager cMgr = cmBean.create(getCurrentManager().createCreationalContext(cmBean));
+ Field ccField = AbstractConversationManager.class.getDeclaredField("currentConversation");
+ ccField.setAccessible(true);
+ assert ccField.get(cMgr) != null;
+
ByteArrayOutputStream serialized = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(serialized);
@@ -36,5 +42,6 @@
Object deserialized = in.readObject();
assert deserialized instanceof ConversationManager;
+ assert ccField.get(deserialized) != null;
}
}
15 years
Weld SVN: r5437 - in core/trunk/tests/src/test/java/org/jboss/weld/tests: serialization and 1 other directory.
by weld-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-01-12 07:40:51 -0500 (Tue, 12 Jan 2010)
New Revision: 5437
Added:
core/trunk/tests/src/test/java/org/jboss/weld/tests/serialization/
core/trunk/tests/src/test/java/org/jboss/weld/tests/serialization/SerializationTest.java
Log:
ConversationManager serialization test
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/serialization/SerializationTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/serialization/SerializationTest.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/serialization/SerializationTest.java 2010-01-12 12:40:51 UTC (rev 5437)
@@ -0,0 +1,40 @@
+package org.jboss.weld.tests.serialization;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import javax.enterprise.inject.spi.Bean;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.weld.conversation.ConversationManager;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.testng.annotations.Test;
+
+@Artifact
+public class SerializationTest extends AbstractWeldTest
+{
+ @SuppressWarnings("unchecked")
+ @Test(description="WELD-363")
+ public void testConversationManagerSerializable()
+ throws IOException, ClassNotFoundException
+ {
+ Bean<ConversationManager> cmBean = (Bean<ConversationManager>) getCurrentManager()
+ .getBeans(ConversationManager.class).iterator().next();
+
+ ConversationManager cMgr = cmBean.create(getCurrentManager().createCreationalContext(cmBean));
+
+ ByteArrayOutputStream serialized = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream(serialized);
+
+ out.writeObject(cMgr);
+ out.flush();
+
+ ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(serialized.toByteArray()));
+ Object deserialized = in.readObject();
+
+ assert deserialized instanceof ConversationManager;
+ }
+}
15 years
Weld SVN: r5436 - in core/trunk/impl/src/main/java/org/jboss/weld: introspector and 1 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-01-12 06:51:13 -0500 (Tue, 12 Jan 2010)
New Revision: 5436
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/injection/WeldInjectionPoint.java
core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldParameter.java
core/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldParameter.java
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldParameterImpl.java
Log:
Actually use the declaring class
Modified: core/trunk/impl/src/main/java/org/jboss/weld/injection/WeldInjectionPoint.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/injection/WeldInjectionPoint.java 2010-01-11 23:28:05 UTC (rev 5435)
+++ core/trunk/impl/src/main/java/org/jboss/weld/injection/WeldInjectionPoint.java 2010-01-12 11:51:13 UTC (rev 5436)
@@ -41,7 +41,7 @@
public WeldInjectionPointSerializationProxy(WeldInjectionPoint<T, S> injectionPoint)
{
this.declaringBeanId = Container.instance().services().get(ContextualStore.class).putIfAbsent(injectionPoint.getBean());
- this.declaringClass = injectionPoint.getBean().getBeanClass();
+ this.declaringClass = injectionPoint.getDeclaringType().getJavaClass();
}
protected Bean<T> getDeclaringBean()
@@ -56,6 +56,8 @@
}
+ public WeldClass<?> getDeclaringType();
+
/**
* Injects an instance
*
Modified: core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldParameter.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldParameter.java 2010-01-11 23:28:05 UTC (rev 5435)
+++ core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldParameter.java 2010-01-12 11:51:13 UTC (rev 5436)
@@ -40,4 +40,9 @@
return delegate().getDeclaringWeldCallable();
}
+ public WeldClass<X> getDeclaringType()
+ {
+ return delegate().getDeclaringType();
+ }
+
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldParameter.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldParameter.java 2010-01-11 23:28:05 UTC (rev 5435)
+++ core/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldParameter.java 2010-01-12 11:51:13 UTC (rev 5436)
@@ -29,5 +29,7 @@
{
public WeldCallable<?, X, ?> getDeclaringWeldCallable();
+
+ public WeldClass<X> getDeclaringType();
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldParameterImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldParameterImpl.java 2010-01-11 23:28:05 UTC (rev 5435)
+++ core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldParameterImpl.java 2010-01-12 11:51:13 UTC (rev 5436)
@@ -27,6 +27,7 @@
import org.jboss.weld.exceptions.ForbiddenArgumentException;
import org.jboss.weld.introspector.WeldCallable;
+import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.introspector.WeldParameter;
import org.jboss.weld.resources.ClassTransformer;
import org.jboss.weld.util.reflection.HierarchyDiscovery;
@@ -157,4 +158,9 @@
return null;
}
+ public WeldClass<X> getDeclaringType()
+ {
+ return getDeclaringWeldCallable().getDeclaringType();
+ }
+
}
15 years
Weld SVN: r5435 - core/trunk/jboss-tck-runner/src/test/resources.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-01-11 18:28:05 -0500 (Mon, 11 Jan 2010)
New Revision: 5435
Modified:
core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml
Log:
exclude broken tests
Modified: core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml
===================================================================
--- core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml 2010-01-11 23:27:46 UTC (rev 5434)
+++ core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml 2010-01-11 23:28:05 UTC (rev 5435)
@@ -107,6 +107,12 @@
<exclude name="testResolveByTypeWithTypeParameter"/>
</methods>
</class>
+ <class name="org.jboss.jsr299.tck.tests.policy.PolicyAvailabilityTest">
+ <methods>
+ <exclude name="testProducerPoliciesOnClass" />
+ <exclude name="testProducerPoliciesOnMethodAndField" />
+ </methods>
+ ></class>
</classes>
</test>
15 years
Weld SVN: r5434 - core/trunk/impl/src/main/java/org/jboss/weld/bean.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-01-11 18:27:46 -0500 (Mon, 11 Jan 2010)
New Revision: 5434
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java
Log:
remove tangle
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java 2010-01-11 23:13:03 UTC (rev 5433)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java 2010-01-11 23:27:46 UTC (rev 5434)
@@ -178,7 +178,6 @@
super.initialize(environment);
checkProducerReturnType();
initPassivationCapable();
- initAlternative();
}
private void initPassivationCapable()
@@ -206,12 +205,6 @@
}
@Override
- protected void initAlternative()
- {
- super.alternative = Beans.isAlternative(getWeldAnnotated(), getMergedStereotypes()) || getDeclaringBean().isAlternative();
- }
-
- @Override
public boolean isPassivationCapableBean()
{
return passivationCapableBean;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java 2010-01-11 23:13:03 UTC (rev 5433)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java 2010-01-11 23:27:46 UTC (rev 5434)
@@ -23,12 +23,12 @@
import java.lang.reflect.Member;
import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.Alternative;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.context.WeldCreationalContext;
import org.jboss.weld.introspector.WeldMember;
import org.jboss.weld.manager.BeanManagerImpl;
+import org.jboss.weld.util.Beans;
import org.slf4j.cal10n.LocLogger;
/**
@@ -52,6 +52,7 @@
public void initialize(BeanDeployerEnvironment environment)
{
super.initialize(environment);
+ initAlternative();
}
/**
@@ -97,18 +98,7 @@
@Override
protected void initAlternative()
{
- if (getDeclaringBean().isAlternative())
- {
- super.alternative = true;
- }
- else if (getWeldAnnotated().isAnnotationPresent(Alternative.class))
- {
- super.alternative = true;
- }
- else if (getMergedStereotypes().isAlternative())
- {
- super.alternative = true;
- }
+ super.alternative = Beans.isAlternative(getWeldAnnotated(), getMergedStereotypes()) || getDeclaringBean().isAlternative();
}
@Override
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java 2010-01-11 23:13:03 UTC (rev 5433)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java 2010-01-11 23:27:46 UTC (rev 5434)
@@ -70,7 +70,6 @@
initTypes();
initQualifiers();
initStereotypes();
- initAlternative();
}
@Override
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java 2010-01-11 23:13:03 UTC (rev 5433)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java 2010-01-11 23:27:46 UTC (rev 5434)
@@ -81,7 +81,6 @@
initQualifiers();
this.id = new StringBuilder().append(BEAN_ID_PREFIX).append(getClass().getSimpleName()).append(BEAN_ID_SEPARATOR).append(declaringBean.getWeldAnnotated().getName()).append(getWeldAnnotated().getSignature().toString()).toString();
initStereotypes();
- initAlternative();
initProducerMethodInjectableParameters();
}
15 years
Weld SVN: r5433 - core/trunk/impl/src/main/java/org/jboss/weld/bean.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-01-11 18:13:03 -0500 (Mon, 11 Jan 2010)
New Revision: 5433
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java
Log:
WELD-78
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java 2010-01-11 23:08:56 UTC (rev 5432)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java 2010-01-11 23:13:03 UTC (rev 5433)
@@ -42,11 +42,12 @@
*/
public class InterceptorImpl<T> extends ManagedBean<T> implements Interceptor<T>
{
+
private final InterceptorClassMetadata interceptorClassMetadata;
private final Set<Annotation> interceptorBindingTypes;
- private boolean serializable;
+ private final boolean serializable;
protected InterceptorImpl(WeldClass<T> type, BeanManagerImpl manager)
{
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java 2010-01-11 23:08:56 UTC (rev 5432)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java 2010-01-11 23:13:03 UTC (rev 5433)
@@ -55,11 +55,8 @@
{
// The underlying method
private MethodInjectionPoint<T, X> method;
-
private DisposalMethod<X, ?> disposalMethodBean;
-
private ProducerMethod<?, ?> specializedBean;
-
private final String id;
/**
@@ -164,7 +161,7 @@
// TODO use annotated item?
for (Type type : getDeclaringBean().getTypes())
{
- if (type instanceof Class)
+ if (type instanceof Class<?>)
{
if (SecureReflections.methodExists((Class<?>) type, getWeldAnnotated().getName(), getWeldAnnotated().getParameterTypesAsArray()))
{
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java 2010-01-11 23:08:56 UTC (rev 5432)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java 2010-01-11 23:13:03 UTC (rev 5433)
@@ -392,7 +392,7 @@
{
for (Type type : getTypes())
{
- if (type instanceof Class)
+ if (type instanceof Class<?>)
{
for (Method m : SecureReflections.getMethods((Class<?>) type))
{
@@ -427,7 +427,9 @@
{
InterceptionModel<Class<?>, SerializableContextual<javax.enterprise.inject.spi.Interceptor<?>, ?>> model = beanManager.getCdiInterceptorsRegistry().getInterceptionModel(ejbDescriptor.getBeanClass());
if (model != null)
+ {
getManager().getServices().get(EjbServices.class).registerInterceptors(getEjbDescriptor().delegate(), new InterceptorBindingsAdapter(model));
+ }
}
}
15 years
Weld SVN: r5432 - in core/trunk/impl/src/main/java/org/jboss/weld/bean: builtin and 1 other directory.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-01-11 18:08:56 -0500 (Mon, 11 Jan 2010)
New Revision: 5432
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/RIBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractBuiltInBean.java
Log:
WELD-78
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java 2010-01-11 23:06:31 UTC (rev 5431)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java 2010-01-11 23:08:56 UTC (rev 5432)
@@ -296,13 +296,6 @@
}
}
- @Override
- public String getDescription()
- {
- // TODO Auto-generated method stub
- return super.getDescription("decorator");
- }
-
public Set<MethodSignature> getDecoratedMethodSignatures()
{
return decoratedMethodSignatures;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java 2010-01-11 23:06:31 UTC (rev 5431)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java 2010-01-11 23:08:56 UTC (rev 5432)
@@ -136,12 +136,6 @@
}
@Override
- public String getDescription()
- {
- return disposalMethodInjectionPoint.toString();
- }
-
- @Override
public boolean isNullable()
{
// Not relevant
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java 2010-01-11 23:06:31 UTC (rev 5431)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java 2010-01-11 23:08:56 UTC (rev 5432)
@@ -61,7 +61,6 @@
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
import org.jboss.weld.serialization.spi.helpers.SerializableContextual;
import org.jboss.weld.util.Beans;
-import org.jboss.weld.util.Names;
import org.jboss.weld.util.reflection.Reflections;
import org.slf4j.cal10n.LocLogger;
import org.slf4j.ext.XLogger;
@@ -445,36 +444,7 @@
}
}
-
- /**
- * Gets a string representation
- *
- * @return The string representation
- */
@Override
- public String getDescription()
- {
- return getDescription("simple bean");
- }
-
- protected String getDescription(String beanType)
- {
- StringBuilder buffer = new StringBuilder();
- buffer.append(Names.scopeTypeToString(getScope()));
- if (getName() == null)
- {
- buffer.append("unnamed ").append(beanType);
- }
- else
- {
- buffer.append(beanType).append(" '" + getName() + "'");
- }
- buffer.append(" ").append(getType().getName()).append(", ");
- buffer.append(" API types = ").append(Names.typesToString(getTypes())).append(", binding types = " + Names.annotationsToString(getQualifiers()));
- return buffer.toString();
- }
-
- @Override
public ManagedBean<?> getSpecializedBean()
{
return specializedBean;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java 2010-01-11 23:06:31 UTC (rev 5431)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java 2010-01-11 23:08:56 UTC (rev 5432)
@@ -29,7 +29,6 @@
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.introspector.WeldField;
import org.jboss.weld.manager.BeanManagerImpl;
-import org.jboss.weld.util.Names;
/**
* Represents a producer field
@@ -134,28 +133,6 @@
{
return field.getPropertyName();
}
-
- /**
- * Gets a string representation
- *
- * @return The string representation
- */
- @Override
- public String getDescription()
- {
- StringBuilder buffer = new StringBuilder();
- buffer.append("Annotated " + Names.scopeTypeToString(getScope()));
- if (getName() == null)
- {
- buffer.append("unnamed producer field bean");
- }
- else
- {
- buffer.append("simple producer field bean '" + getName() + "'");
- }
- buffer.append(" [" + getBeanClass().getName() + "] for class type [" + getType().getName() + "] API types " + getTypes() + ", binding types " + getQualifiers());
- return buffer.toString();
- }
@Override
public AbstractBean<?, ?> getSpecializedBean()
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java 2010-01-11 23:06:31 UTC (rev 5431)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java 2010-01-11 23:08:56 UTC (rev 5432)
@@ -42,7 +42,6 @@
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.introspector.WeldParameter;
import org.jboss.weld.manager.BeanManagerImpl;
-import org.jboss.weld.util.Names;
import org.jboss.weld.util.reflection.SecureReflections;
/**
@@ -245,29 +244,7 @@
return disposalMethodBean;
}
- /**
- * Gets a string representation
- *
- * @return The string representation
- */
@Override
- public String getDescription()
- {
- StringBuilder buffer = new StringBuilder();
- buffer.append(Names.scopeTypeToString(getScope()));
- if (getName() == null)
- {
- buffer.append("unnamed producer method bean");
- }
- else
- {
- buffer.append("simple producer method bean '" + getName() + "'");
- }
- buffer.append(" [" + getBeanClass().getName() + "] for class type [" + getType().getName() + "] API types " + getTypes() + ", binding types " + getQualifiers());
- return buffer.toString();
- }
-
- @Override
public AbstractBean<?, ?> getSpecializedBean()
{
return specializedBean;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/RIBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/RIBean.java 2010-01-11 23:06:31 UTC (rev 5431)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/RIBean.java 2010-01-11 23:08:56 UTC (rev 5432)
@@ -140,8 +140,5 @@
{
return id;
}
-
- public abstract String getDescription();
-
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java 2010-01-11 23:06:31 UTC (rev 5431)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java 2010-01-11 23:08:56 UTC (rev 5432)
@@ -340,30 +340,6 @@
throw new DefinitionException(MESSAGE_DRIVEN_BEANS_CANNOT_BE_MANAGED, this);
}
}
-
- /**
- * Gets a string representation
- *
- * @return The string representation
- */
- @Override
- public String getDescription()
- {
- StringBuilder buffer = new StringBuilder();
- // buffer.append("Annotated " + Names.scopeTypeToString(getScopeType()) +
- // Names.ejbTypeFromMetaData(getEjbMetaData()));
- if (getName() == null)
- {
- buffer.append(" unnamed enterprise bean");
- }
- else
- {
- buffer.append(" enterprise bean '" + getName() + "'");
- }
- buffer.append(" [" + getType().getName() + "] ");
- buffer.append("API types " + getTypes() + ", binding types " + getQualifiers());
- return buffer.toString();
- }
@Override
public boolean isPassivationCapableBean()
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractBuiltInBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractBuiltInBean.java 2010-01-11 23:06:31 UTC (rev 5431)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractBuiltInBean.java 2010-01-11 23:08:56 UTC (rev 5432)
@@ -120,10 +120,4 @@
return true;
}
- @Override
- public String getDescription()
- {
- return "Built-in bean " + getClass().getSimpleName();
- }
-
}
15 years
Weld SVN: r5431 - in core/trunk/impl/src/main/java/org/jboss/weld: bootstrap/events and 1 other directory.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-01-11 18:06:31 -0500 (Mon, 11 Jan 2010)
New Revision: 5431
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/CustomDecoratorWrapper.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AfterBeanDiscoveryImpl.java
Log:
WELD-78
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/CustomDecoratorWrapper.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/CustomDecoratorWrapper.java 2010-01-11 23:02:57 UTC (rev 5430)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/CustomDecoratorWrapper.java 2010-01-11 23:06:31 UTC (rev 5431)
@@ -33,36 +33,34 @@
*
* @author Marius Bogoevici
*/
-public class CustomDecoratorWrapper extends ForwardingDecorator<Object> implements WeldDecorator<Object>
+public class CustomDecoratorWrapper<T> extends ForwardingDecorator<T> implements WeldDecorator<T>
{
- private Decorator<Object> delegate;
- private WeldClass<?> annotatedItem;
+ private Decorator<T> delegate;
+ private WeldClass<T> weldClass;
private Set<MethodSignature> decoratedMethodSignatures;
- public static CustomDecoratorWrapper of(Decorator<?> delegate, BeanManagerImpl beanManager)
+ public static <T> CustomDecoratorWrapper<T> of(Decorator<T> delegate, BeanManagerImpl beanManager)
{
- return new CustomDecoratorWrapper((Decorator<Object>) delegate, beanManager);
+ return new CustomDecoratorWrapper<T>(delegate, beanManager);
}
- private CustomDecoratorWrapper(Decorator<Object> delegate, BeanManagerImpl beanManager)
+ private CustomDecoratorWrapper(Decorator<T> delegate, BeanManagerImpl beanManager)
{
this.delegate = delegate;
- ClassTransformer transformer = beanManager.getServices().get(ClassTransformer.class);
- Class<?> beanClass = delegate.getBeanClass();
- this.annotatedItem = transformer.loadClass(beanClass);
+ this.weldClass = beanManager.getServices().get(ClassTransformer.class).loadClass((Class<T>) delegate.getBeanClass());
this.decoratedMethodSignatures = Deployers.getDecoratedMethodSignatures(beanManager, delegate.getDecoratedTypes());
}
@Override
- protected Decorator<Object> delegate()
+ protected Decorator<T> delegate()
{
return delegate;
}
public WeldClass<?> getWeldAnnotated()
{
- return annotatedItem;
+ return weldClass;
}
public Set<MethodSignature> getDecoratedMethodSignatures()
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AfterBeanDiscoveryImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AfterBeanDiscoveryImpl.java 2010-01-11 23:02:57 UTC (rev 5430)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AfterBeanDiscoveryImpl.java 2010-01-11 23:06:31 UTC (rev 5431)
@@ -23,9 +23,9 @@
import javax.enterprise.context.spi.Context;
import javax.enterprise.inject.spi.AfterBeanDiscovery;
import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.Decorator;
+import javax.enterprise.inject.spi.Interceptor;
import javax.enterprise.inject.spi.ObserverMethod;
-import javax.enterprise.inject.spi.Interceptor;
-import javax.enterprise.inject.spi.Decorator;
import org.jboss.weld.bean.CustomDecoratorWrapper;
import org.jboss.weld.bootstrap.BeanDeployment;
@@ -63,7 +63,7 @@
{
beanManager.addInterceptor((Interceptor<?>) bean);
}
- else if (bean instanceof Decorator)
+ else if (bean instanceof Decorator<?>)
{
beanManager.addDecorator(CustomDecoratorWrapper.of((Decorator<?>)bean, beanManager));
}
15 years
Weld SVN: r5430 - core/trunk/impl/src/main/java/org/jboss/weld/bean.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-01-11 18:02:57 -0500 (Mon, 11 Jan 2010)
New Revision: 5430
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java
Log:
WELD-78
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java 2010-01-11 23:00:56 UTC (rev 5429)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java 2010-01-11 23:02:57 UTC (rev 5430)
@@ -41,7 +41,6 @@
private static final LocLogger log = loggerFactory().getLogger(BEAN);
private AbstractClassBean<X> declaringBean;
- private boolean policy;
public AbstractReceiverBean(String idSuffix, AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
{
@@ -95,29 +94,20 @@
return declaringBean;
}
- /* (non-Javadoc)
- * @see org.jboss.weld.bean.AbstractBean#isPolicy()
- */
@Override
- public boolean isAlternative()
- {
- return policy;
- }
-
- @Override
protected void initAlternative()
{
if (getDeclaringBean().isAlternative())
{
- this.policy = true;
+ super.alternative = true;
}
else if (getWeldAnnotated().isAnnotationPresent(Alternative.class))
{
- this.policy = true;
+ super.alternative = true;
}
else if (getMergedStereotypes().isAlternative())
{
- this.policy = true;
+ super.alternative = true;
}
}
15 years