public Object run() { try { System.loadLibrary("jawt"); } catch (UnsatisfiedLinkError e) { // catch and ignore an already loaded in another classloader // exception, as vm already has it loaded } return null; }
/** * The instance of the HunspellManager, looks for the native lib in * the directory specified. * * @param libDir Optional absolute directory where the native lib can be found. */ public static Hunspell getInstance(String libDir) throws UnsatisfiedLinkError, UnsupportedOperationException { if (hunspell != null) { return hunspell; } hunspell = new Hunspell(libDir); return hunspell; }
void load0(String filename, ClassLoader cL, boolean check) throws SecurityException, UnsatisfiedLinkError { if (check) { if (filename == null) { throw new NullPointerException(); } SecurityManager currentSecurity = System.getSecurityManager(); if (currentSecurity != null) { currentSecurity.checkLink(filename); } } VMClassRegistry.loadLibrary(filename, cL); // Should throw UnsatisfiedLinkError if needs. }
public static boolean implementsInterface( String classname, Class tosubclass ) { try { if ( classname.equals("org.apache.xalan.extensions.ExtensionHandlerGeneral") || classname.equals("org.apache.log4j.net.ZeroConfSupport") ) throw new ClassNotFoundException( "Classes breaking this work" ); // JE: Here there is a bug that is that it is not possible // to have ALL interfaces with this function!!! // This is really stupid but that's life // So it is compulsory that AlignmentProcess be declared // as implemented Class cl = Class.forName(classname); // It is possible to suppress here abstract classes by: if ( java.lang.reflect.Modifier.isAbstract( cl.getModifiers() ) ) return false; Class[] interfaces = cl.getInterfaces(); for ( int i=interfaces.length-1; i >= 0 ; i-- ){ if ( interfaces[i] == tosubclass ) { //logger.trace(" -j-> {}", classname); return true; } //logger.trace(" I> {}", interfaces[i] ); } // Not one of our classes } catch ( ExceptionInInitializerError eiie ) { } catch ( NoClassDefFoundError ncdex ) { } catch ( ClassNotFoundException cnfex ) { } catch ( UnsatisfiedLinkError ule ) { //logger.trace(" ******** {}", classname); } return false; }
private static boolean isLoggable(int logLevel) { try { return Log.isLoggable(LOG_TAG, logLevel); } catch (UnsatisfiedLinkError e) { // this lets the tests run on the jvm as well. return false; } }
/** * @com.intel.drl.spec_ref */ public void load(String filename) throws SecurityException, UnsatisfiedLinkError { load0(filename, VMClassRegistry.getClassLoader(VMStack.getCallerClass(0)), true); }
/** * @com.intel.drl.spec_ref */ public void loadLibrary(String libname) throws SecurityException, UnsatisfiedLinkError { loadLibrary0(libname, VMClassRegistry.getClassLoader(VMStack.getCallerClass(0)), true); }
/** * The instance of the HunspellManager, looks for the native lib in the * default directories */ public static Hunspell getInstance() throws UnsatisfiedLinkError, UnsupportedOperationException { return getInstance(null); }