return this;
}
public <T> T getInstance(Bean<T> bean)
{
Context context = null;
T instance = null;
boolean dependentContext = false;
try
{
if(!ContextFactory.checkDependentContextActive())
{
ContextFactory.activateDependentContext();
dependentContext = true;
}
CreationalContext<T> creationalContext = CreationalContextFactory.getInstance().getCreationalContext(bean);
/* @ScopeType is normal */
if (WebBeansUtil.isScopeTypeNormal(bean.getScopeType()))
{
if (this.proxyMap.containsKey(bean))
{
instance = (T) this.proxyMap.get(bean);
}
else
{
instance = (T) JavassistProxyFactory.createNewProxyInstance(bean);
this.proxyMap.put(bean, instance);
}
//Push proxy instance into the creational context
creationalContext.push(instance);
}
/* @ScopeType is not normal */
else
{
context = getContext(bean.getScopeType());
instance = (T)context.get(bean, creationalContext);
}
}
finally
{