/* Default library names - use 2.x in preference to 1.x if both are available */ privatestaticfinal String [] NAMES = {"tcnative-2", "libtcnative-2", "tcnative-1", "libtcnative-1"}; /* System property used to define CATALINA_HOME */ privatestaticfinal String CATALINA_HOME_PROP = "catalina.home"; /* *AhandletotheuniqueLibrarysingletoninstance.
*/ privatestatic Library _instance = null;
private Library() throws Exception { boolean loaded = false;
StringBuilder err = new StringBuilder();
File binLib = new File(System.getProperty(CATALINA_HOME_PROP), "bin"); for (int i = 0; i < NAMES.length; i++) {
File library = new File(binLib, System.mapLibraryName(NAMES[i])); try {
System.load(library.getAbsolutePath());
loaded = true;
} catch (ThreadDeath | VirtualMachineError t) { throw t;
} catch (Throwable t) { if (library.exists()) { // File exists but failed to load throw t;
} if (i > 0) {
err.append(", ");
}
err.append(t.getMessage());
} if (loaded) { break;
}
} if (!loaded) {
String path = System.getProperty("java.library.path");
String [] paths = path.split(File.pathSeparator); for (String value : NAMES) { try {
System.loadLibrary(value);
loaded = true;
} catch (ThreadDeath | VirtualMachineError t) { throw t;
} catch (Throwable t) {
String name = System.mapLibraryName(value); for (String s : paths) {
File fd = new File(s, name); if (fd.exists()) { // File exists but failed to load throw t;
}
} if (err.length() > 0) {
err.append(", ");
}
err.append(t.getMessage());
} if (loaded) { break;
}
}
} if (!loaded) {
StringBuilder names = new StringBuilder(); for (String name : NAMES) {
names.append(name);
names.append(", ");
} thrownew LibraryNotFoundError(names.substring(0, names.length() -2), err.toString());
}
}
/* create global TCN's APR pool *ThishastobethefirstcalltoTCNlibrary.
*/ privatestaticnativeboolean initialize(); /* destroy global TCN's APR pool *ThishastobethelastcalltoTCNlibrary.
*/ publicstaticnativevoid terminate(); /* Internal function for loading APR Features */ privatestaticnativeint version(int what);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.