Sha256: d01071c5ef68047a9e55b21a05194cd0970ce4801b2c8b3ade5530356bfa7331

Contents?: true

Size: 1.44 KB

Versions: 30

Compression:

Stored size: 1.44 KB

Contents

// Copyright 2000 Samuele Pedroni

package jxxload_help;

import org.python.core.PyJavaClass;

public class DiscardHelp extends Object {

  private DiscardHelp() {
  }

  private static boolean check(Class c,ClassLoader loader,java.util.Vector interfaces) {
    try {
        Class s = c;
        do {
            if (s.getClassLoader() == loader) return true;
            s = s.getSuperclass();
        } while (s != null);
        
        for(java.util.Enumeration enumm=interfaces.elements(); enumm.hasMoreElements();) {
            Class intf = (Class)enumm.nextElement();
            if (intf.isAssignableFrom(c)) return true;
        }
        
    } catch(SecurityException e) {
    }
    return false;
  }

  // clearly not thread safe
  public static void discard(ClassLoader loader,java.util.Vector interfaces) {
    
    org.python.core.InternalTables tbl = PyJavaClass.getInternalTables();
    
    tbl._beginCanonical();
    
    PyJavaClass jc;
    while ((jc = (PyJavaClass)tbl._next()) != null ) {
        Class c = (Class)jc.__tojava__(Class.class);
        if(check(c,loader,interfaces)) tbl._flushCurrent();    
    }
    
    tbl._beginOverAdapterClasses();
    
    Class c;
    
    while ((c = (Class)tbl._next()) != null) {
        if(interfaces.contains(c)) tbl._flushCurrent();
    }
    
    tbl._beginOverAdapters();
    
    while ((c = (Class)tbl._next()) != null) {
        if(interfaces.contains(c)) tbl._flushCurrent();
    }
    
  }

}

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
rubyfox-server-2.19.2.0 lib/rubyfox/server/data/lib/Lib/jxxload_help/DiscardHelp.java
rubyfox-server-2.17.3.2 lib/rubyfox/server/data/lib/Lib/jxxload_help/DiscardHelp.java
rubyfox-server-2.17.3.1 lib/rubyfox/server/data/lib/Lib/jxxload_help/DiscardHelp.java
rubyfox-server-2.17.3.0 lib/rubyfox/server/data/lib/Lib/jxxload_help/DiscardHelp.java
rubyfox-server-2.16.3.2 lib/rubyfox/server/data/lib/Lib/jxxload_help/DiscardHelp.java
rubyfox-server-2.16.3.1 lib/rubyfox/server/data/lib/Lib/jxxload_help/DiscardHelp.java
rubyfox-server-2.16.0.4 lib/rubyfox/server/data/lib/Lib/jxxload_help/DiscardHelp.java
rubyfox-server-2.16.0.3 lib/rubyfox/server/data/lib/Lib/jxxload_help/DiscardHelp.java
rubyfox-server-2.16.0.2 lib/rubyfox/server/data/lib/Lib/jxxload_help/DiscardHelp.java
rubyfox-server-2.16.0.1 lib/rubyfox/server/data/lib/Lib/jxxload_help/DiscardHelp.java
rubyfox-server-2.16.0.0 lib/rubyfox/server/data/lib/Lib/jxxload_help/DiscardHelp.java
rubyfox-server-2.13.7.3 lib/rubyfox/server/data/lib/Lib/jxxload_help/DiscardHelp.java
rubyfox-server-2.13.6.2 lib/rubyfox/server/data/lib/Lib/jxxload_help/DiscardHelp.java
rubyfox-server-2.13.6.1 lib/rubyfox/server/data/lib/Lib/jxxload_help/DiscardHelp.java
rubyfox-server-2.13.5.1 lib/rubyfox/server/data/lib/Lib/jxxload_help/DiscardHelp.java
rubyfox-server-2.13.4.1 lib/rubyfox/server/data/lib/Lib/jxxload_help/DiscardHelp.java
rubyfox-server-2.13.3.1 lib/rubyfox/server/data/lib/Lib/jxxload_help/DiscardHelp.java
rubyfox-server-2.12.5.1 lib/rubyfox/server/data/lib/Lib/jxxload_help/DiscardHelp.java
rubyfox-server-2.12.5.0 lib/rubyfox/server/data/lib/Lib/jxxload_help/DiscardHelp.java
rubyfox-server-2.12.4.0 lib/rubyfox/server/data/lib/Lib/jxxload_help/DiscardHelp.java