Re: [weld-dev] Weld BOM
by Ondřej Skutka
Any estimate Weld builds could start working again? Anything QE can do
about it?
On Mon, 2010-05-03 at 17:16 +0200, David Allen wrote:
> Yes, I know, but am powerless to do anything about it. We need to get a
> snapshot of a dependency deployed to the Maven snapshot repo.
>
> Am Montag, den 03.05.2010, 16:30 +0200 schrieb Ondřej Skutka:
> > Hi!
> >
> > After your commit (r6193) to /core/trunk/bom/pom.xml, Weld trunk
> > standalone job stopped working. See
> > http://hudson.jboss.org/hudson/view/Seam/job/Weld-trunk-standalone/2138/
> >
> > Ondra
> >
>
>
14 years, 7 months
Potentially un-spec'd behavior for BeanManager.createAnnotatedType(...)
by Lincoln Baxter, III
Hey Guys,
I'm working on an extension that @Observes ProcessAnnotatedType in order to
modify the typing information for fields annotated with a specific
Annotation.
When I use BeanManager to later construct an instance of AnnotatedType for
that modified class, however, I am not supplied with the modified
AnnotatedType instance, I am given a brand new instance that does not
include my extension's prior modifications.
If this is right, then there needs to be some way to retrieve the previously
modified data from the BeanManager, otherwise, the information is
effectively lost unless the BeanManager is creating a full contextual
instance of the class, not merely providing injection.
So this doesn't seem right to me. Thoughts?
Example code below.
Thanks,
Lincoln
--------------------------------------------------------------------------------------------------------
public <T> void processAnnotatedType(@Observes final
ProcessAnnotatedType<T> event)
{
AnnotatedTypeBuilder<T> builder =
AnnotatedTypeBuilder.newInstance(event.getAnnotatedType());
builder.readAnnotationsFromUnderlyingType();
boolean modifiedType = false;
for (AnnotatedField<?> f : event.getAnnotatedType().getFields())
{
if (f.isAnnotationPresent(InputField.class))
{
builder.overrideFieldType(f.getJavaMember(), Object.class);
modifiedType = true;
}
}
if (modifiedType)
{
AnnotatedType<T> replacement = builder.create();
event.setAnnotatedType(replacement);
}
}
Then later... the AnnotatedType created in the method below not reflect
changes made to the type in the extension above.
public void injectNonContextualInstance(final Object instance)
{
if (instance != null)
{
CreationalContext<Object> creationalContext =
manager.createCreationalContext(null);
InjectionTarget<Object> injectionTarget = (InjectionTarget<Object>)
manager.createInjectionTarget(beanManager.createAnnotatedType(instance.getClass()));
injectionTarget.inject(instance, creationalContext);
}
}
--
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"
14 years, 7 months
InterceptorExtension causing unsatisfied injection point?
by Lincoln Baxter, III
Using Weld SVN trunk:
For some reason this class is causing deployment failures for me,
complaining that "InterceptorExtension" cannot be satisfied as an injection
point. Removing @Inject definitely clears up the issue... but... I'm
guessing that's not the desired fix ;)
Caused by: org.jboss.weld.DeploymentException: Injection point has
unstatisfied dependencies. Injection point: field
org.jboss.weld.extensions.interceptor.Interceptors.interceptorExtension;
Qualifiers: [@javax.enterprise.inject.Default()]
at org.jboss.weld.Validator.validateInjectionPoint(Validator.java:232)
at org.jboss.weld.Validator.validateBean(Validator.java:80)
at org.jboss.weld.Validator.validateRIBean(Validator.java:100)
at org.jboss.weld.Validator.validateBeans(Validator.java:282)
public class Interceptors
{
@Inject
private InterceptorExtension interceptorExtension;
private Interceptors()
{
// TODO Auto-generated constructor stub
}
public boolean isInterceptorEnabled(final Class<?> clazz)
{
return interceptorExtension.getEnabledInterceptors().contains(clazz);
}
}
--
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"
14 years, 7 months