create() method of container Bean implementations should be
reproducible with user Bean implementations
-------------------------------------------------------------------------------------------------------
Key: WELD-313
URL:
https://jira.jboss.org/jira/browse/WELD-313
Project: Weld
Issue Type: Bug
Components: Class Beans (Managed and Session)
Affects Versions: 1.0.0.GA
Reporter: Gavin King
Assignee: David Allen
Priority: Critical
Fix For: 1.0.1.CR1
ManagedBean.create() looks like this:
public T create(CreationalContext<T> creationalContext)
{
T instance = getInjectionTarget().produce(creationalContext);
getInjectionTarget().inject(instance, creationalContext);
if (isInterceptionCandidate() && (hasCdiBoundInterceptors() ||
hasDirectlyDefinedInterceptors()))
{
InterceptionUtils.executePostConstruct(instance);
}
else
{
getInjectionTarget().postConstruct(instance);
}
return instance;
}
The code that is aware of interceptors needs to be sucked into
InjectionTarget.postConstruct(), since a portable extension can't easily reproduce
that logic. create() should look like:
public T create(CreationalContext<T> creationalContext)
{
T instance = getInjectionTarget().produce(creationalContext);
getInjectionTarget().inject(instance, creationalContext);
getInjectionTarget().postConstruct(instance);
return instance;
}
Same goes for destroy().
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: