Пример #1
0
  JarReader getJarReader() {
    if (jarReader == null) {

      ClassFactoryContext cfc =
          (ClassFactoryContext) ContextService.getContextOrNull(ClassFactoryContext.CONTEXT_ID);

      jarReader = cfc.getJarReader();
    }
    return jarReader;
  }
Пример #2
0
  private String getClasspath() throws StandardException {

    ClassFactoryContext cfc =
        (ClassFactoryContext) ContextService.getContextOrNull(ClassFactoryContext.CONTEXT_ID);

    PersistentSet ps = cfc.getPersistentSet();

    String classpath = PropertyUtil.getServiceProperty(ps, Property.DATABASE_CLASSPATH);

    //
    // In per database mode we must always have a classpath. If we do not
    // yet have one we make one up.
    if (classpath == null) classpath = "";

    return classpath;
  }
Пример #3
0
  private boolean lockClassLoader(ShExQual qualifier) throws StandardException {

    if (lf == null) return false;

    ClassFactoryContext cfc =
        (ClassFactoryContext) ContextService.getContextOrNull(ClassFactoryContext.CONTEXT_ID);

    // This method can be called from outside of the database
    // engine, in which case tc will be null. In that case
    // we lock the class loader only for the duration of
    // the loadClass().
    CompatibilitySpace lockSpace = null;

    if (cfc != null) {
      lockSpace = cfc.getLockSpace();
    }
    if (lockSpace == null) lockSpace = compat;

    Object lockGroup = lockSpace.getOwner();

    lf.lockObject(lockSpace, lockGroup, classLoaderLock, qualifier, C_LockFactory.TIMED_WAIT);

    return (lockGroup == this);
  }