Package com.caucho.config.scope

Examples of com.caucho.config.scope.ScopeContext


    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)
      return cxt.get(bean);
    else
      return null;
  }
View Full Code Here


    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;
  }
View Full Code Here

TOP

Related Classes of com.caucho.config.scope.ScopeContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.