Skip to content

Commit

Permalink
WELD-313
Browse files Browse the repository at this point in the history
  • Loading branch information
drallen committed Dec 24, 2009
1 parent 1b7ad72 commit f4b0422
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions impl/src/main/java/org/jboss/weld/bean/ManagedBean.java
Expand Up @@ -140,14 +140,7 @@ 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);
}
getInjectionTarget().postConstruct(instance);
return instance;
}

Expand All @@ -171,14 +164,7 @@ public void destroy(T instance, CreationalContext<T> creationalContext)
{
try
{
if (!isInterceptionCandidate() || !(hasCdiBoundInterceptors() || hasDirectlyDefinedInterceptors()))
{
getInjectionTarget().preDestroy(instance);
}
else
{
InterceptionUtils.executePredestroy(instance);
}
getInjectionTarget().preDestroy(instance);
creationalContext.release();
}
catch (Exception e)
Expand Down Expand Up @@ -225,12 +211,26 @@ public void proceed()

public void postConstruct(T instance)
{
defaultPostConstruct(instance);
if (isInterceptionCandidate() && (hasCdiBoundInterceptors() || hasDirectlyDefinedInterceptors()))
{
InterceptionUtils.executePostConstruct(instance);
}
else
{
defaultPostConstruct(instance);
}
}

public void preDestroy(T instance)
{
defaultPreDestroy(instance);
if (!isInterceptionCandidate() || !(hasCdiBoundInterceptors() || hasDirectlyDefinedInterceptors()))
{
defaultPreDestroy(instance);
}
else
{
InterceptionUtils.executePredestroy(instance);
}
}

public void dispose(T instance)
Expand Down

0 comments on commit f4b0422

Please sign in to comment.