if (bean instanceof PassivationCapable)
id = ((PassivationCapable) bean).getId();
else
id = comp.getBeanClass().getName();
ContextContainer context
= (ContextContainer) session.getAttribute("webbeans.resin");
if (context == null) {
context = new SessionContextContainer();
session.setAttribute("webbeans.resin", context);
}
T result = (T) context.get(id);
if (result != null || creationalContext == null)
return result;
result = comp.create(creationalContext);
context.put(comp, id, result, creationalContext);
return (T) result;
}