Alternative producer methods
by Mark Struberg
Dear EG colleagues!
I have a question about @Alternative on producer methods:
consider the following class:
// here is NO alternative annotation!
public class AlternativeOnProducerMethodOnlyBean {
@Produces @Alternative
public IProducedBean generateBean2() {..}
}
So the class itself is NOT annotated as @Alternative
I'm not sure if 5.1.1 allows this or the other way around: if this must be supported.
Imo the important parts are (from 5.1.1)
> Each child <class> element must specify the name of an alternative bean class.
> If there is no class with the specified name, or if the class with the specified
> name is not an alternative bean class, the container automatically detects
> the problem and treats it as a deployment problem.
The question is now how 'an alternative bean class' is to be interpreted ^^
The first paragraph of 5.1.1 says:
> An alternative is selected for the bean archive if either ...
> * the alternative is a producer method, field or resource, and the
> bean class that declares the method or field is listed, ...
But does this qualify the AlternativeOnProducerMethodOnlyBean as 'alternative bean class'?
Any ideas?
Btw: the whole topic of disposal methods for @Alternative producers are completely unspecified...
LieGrue,
strub
12 years, 9 months
Assignability of raw and parameterized types
by Marko Lukša
Hey
How come section 5.2.3., bullet 4 was changed from:
* the required type parameter is an actual type, the bean type
parameter is a type variable and the actual type is assignable *to*
the upper bound, if any, of the type variable...
to:
* the required type parameter is an actual type, the bean type
parameter is a type variable and the actual type is assignable
*from* the upper bound, if any, of the type variable...
Doesn't this mean bean Dao<T extends Persistent> will not be assignable
to Dao<User>?
M.
12 years, 9 months