home *** CD-ROM | disk | FTP | other *** search
- package lotus.notes;
-
- public class NotesThread extends Thread {
- boolean initialized;
- Runnable target;
-
- private static synchronized native void NnotesInitThread();
-
- private static synchronized native void NnotesTermThread();
-
- private static synchronized native void NnotesLoad(boolean var0);
-
- public NotesThread() {
- }
-
- public NotesThread(Runnable var1) {
- super(var1);
- this.target = var1;
- }
-
- public NotesThread(String var1) {
- super(var1);
- }
-
- public NotesThread(Runnable var1, String var2) {
- super(var1, var2);
- this.target = var1;
- }
-
- public NotesThread(ThreadGroup var1, String var2) {
- super(var1, var2);
- }
-
- public NotesThread(ThreadGroup var1, Runnable var2, String var3) {
- super(var1, var2, var3);
- this.target = var2;
- }
-
- public NotesThread(ThreadGroup var1, Runnable var2) {
- super(var1, var2);
- this.target = var2;
- }
-
- static AgentThreadGroup getAgentThreadGroup() {
- ThreadGroup var0;
- for(var0 = Thread.currentThread().getThreadGroup(); var0 != null && !(var0 instanceof AgentThreadGroup); var0 = var0.getParent()) {
- }
-
- return (AgentThreadGroup)var0;
- }
-
- private static void bumpActiveNotesThreadCount(int var0) {
- AgentThreadGroup var1 = getAgentThreadGroup();
- if (var1 != null) {
- var1.bumpActiveNotesThreadCount(var0);
- }
-
- }
-
- public void initThread() {
- if (!this.initialized) {
- bumpActiveNotesThreadCount(1);
- NnotesInitThread();
- this.initialized = true;
- }
-
- }
-
- public void termThread() {
- if (this.initialized) {
- NnotesTermThread();
- bumpActiveNotesThreadCount(-1);
- this.initialized = false;
- }
-
- }
-
- public static void sinitThread() {
- bumpActiveNotesThreadCount(1);
- NnotesInitThread();
- }
-
- public static void stermThread() {
- NnotesTermThread();
- bumpActiveNotesThreadCount(-1);
- }
-
- public final void run() {
- if (!this.initialized) {
- this.initThread();
- }
-
- try {
- if (this.target != null) {
- this.target.run();
- } else {
- this.runNotes();
- }
- } catch (NotesException var6) {
- ((Throwable)var6).printStackTrace();
- } finally {
- this.termThread();
- }
-
- }
-
- public void runNotes() throws NotesException {
- }
-
- public void finalize() {
- if (this.initialized) {
- System.out.println(JavaString.getFormattedString("thread_not_terminated", ((Thread)this).toString()));
- }
-
- }
-
- public static void load(boolean var0) throws NotesException {
- try {
- String var1 = System.getProperty("os.name");
- String var2 = System.getProperty("os.arch");
- boolean var3 = Boolean.getBoolean("lotus.notes.internal.InfoPaneBuilder");
- String var5 = null;
- String var6 = "";
- var1 = var1.toUpperCase();
- var2 = var2.toUpperCase();
- if (!var1.equals("WINDOWS NT") && !var1.equals("WINDOWS 95")) {
- if (var1.equals("WINDOWS")) {
- var5 = "_";
- } else if (var1.equals("OS/2")) {
- var5 = "i";
- } else if (var1.equals("AIX")) {
- var5 = "";
- var6 = "_r";
- } else if (var1.equals("SOLARIS")) {
- var5 = "";
- } else if (var1.equals("HPUX")) {
- var5 = "";
- } else if (var1.equals("OS/400")) {
- var5 = "lib";
- String var7 = System.getProperty("lotus.notes.nativecreated");
- if (var7 != null) {
- var3 = true;
- if (var7.equalsIgnoreCase("TRUE")) {
- var3 = true;
- }
- }
- } else {
- var5 = "";
- }
- } else if (var2.equals("X86")) {
- var5 = "n";
- } else if (var2.equals("ALPHA")) {
- var5 = "a";
- }
-
- if (var5 == null) {
- throw new NotesException(JavaString.getFormattedString("system_dll", var1));
- }
-
- String var4 = var5 + "lsxbe" + var6;
- if (!var3) {
- System.loadLibrary(var4);
- NnotesLoad(var0);
- return;
- }
- } catch (Exception var8) {
- ((Throwable)var8).printStackTrace();
- }
-
- }
-
- static {
- try {
- load(true);
- } catch (Exception var0) {
- }
- }
- }
-