if (xa == null || ! xa.isActive()) {
throw new ContextNotActiveException(L.l("'{0}' cannot be created because @TransactionScoped requires an active transaction.",
bean));
}
ScopeContext cxt = (ScopeContext) xa.getResource("caucho.xa.scope");
if (cxt == null) {
cxt = new ScopeContext();
xa.putResource("caucho.xa.scope", cxt);
xa.registerSynchronization(cxt);
}
T result = cxt.get(bean);
if (result != null || creationalContext == null)
return (T) result;
result = bean.create(creationalContext);
String id = null;
cxt.put(bean, id, result, creationalContext);
return (T) result;
}