/** Returns the database manager for the local environment. */
  private static DatabaseManager getLocalManager() {
    synchronized (_localManager) {
      DatabaseManager manager = _localManager.getLevel();

      if (manager == null) {
        manager = new DatabaseManager();

        _localManager.set(manager);
      }

      return manager;
    }
  }
  public static SchemeMap getLocalScheme() {
    synchronized (_localSchemeMap) {
      SchemeMap map = _localSchemeMap.getLevel();

      if (map == null) {
        map = _localSchemeMap.get().copy();

        if (map == null) map = DEFAULT_SCHEME_MAP.copy();

        _localSchemeMap.set(map);
      }

      return map;
    }
  }
Пример #3
0
  public static EnhancerManager create(ClassLoader loader) {
    EnhancerManager enhancer = _localEnhancer.getLevel(loader);

    if (enhancer == null) {
      enhancer = new EnhancerManager(loader);
      _localEnhancer.set(enhancer, loader);

      for (; loader != null; loader = loader.getParent()) {
        if (loader instanceof DynamicClassLoader) {
          ((DynamicClassLoader) loader).addTransformer(enhancer);
          break;
        }
      }
    }

    return enhancer;
  }