Beispiel #1
0
  public static AppContext findThreadLocal() {

    AppContext context = _tl.get();
    if (context != null) return context;

    AppRequest req = AppRequest.getThreadLocal();
    if (req != null) return req._context;

    Scope s = Scope.getThreadLocal();
    if (s != null) {
      Object foo = s.get("__instance__");
      if (foo instanceof AppContext) return (AppContext) foo;
    }

    return null;
  }
Beispiel #2
0
 /** @unexpose */
 public static String getVersionForLibrary(Scope s, String name) {
   AppRequest ar = AppRequest.getThreadLocal();
   return getVersionForLibrary(s, name, ar == null ? null : ar.getContext());
 }