X-Git-Url: http://git.megacz.com/?p=org.ibex.jinetd.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fjinetd%2FLoader.java;h=7f32fd6fb701cb0d6571a3884ab5c50033091023;hp=5c933c7d13c4504ba2d9f8bdc464c34892b97637;hb=583587a3f34a3d2939bcc2b7bcab51b871f2b0c7;hpb=9219699b69ebb0c743d55862de0e43d43d270f49 diff --git a/src/org/ibex/jinetd/Loader.java b/src/org/ibex/jinetd/Loader.java index 5c933c7..7f32fd6 100644 --- a/src/org/ibex/jinetd/Loader.java +++ b/src/org/ibex/jinetd/Loader.java @@ -1,28 +1,26 @@ +// Copyright 2000-2005 the Contributors, as shown in the revision logs. +// Licensed under the Apache Public Source License 2.0 ("the License"). +// You may not use this file except in compliance with the License. + package org.ibex.jinetd; +import org.ibex.io.*; import org.ibex.util.*; import java.io.*; import java.util.*; +import java.text.*; +import java.net.*; import java.util.zip.*; /** represents a file or directory which is scanned for updates */ public class Loader extends Watcher { - public Loader(String path) { super(path); } - - private TreeClassLoader classloader = new TreeClassLoader(); - public ClassLoader getClassLoader() { - ClassLoader classloader = this.classloader; - if (classloader == null) { - classloader = this.classloader = new TreeClassLoader(); - Log.warn(this, "getting classloader..."); - try { - compileSource(); - } catch (Exception e) { - Log.error(this, e); - } - } - return classloader; - } + public /*synchronized*/ void scan() throws IOException { super.scan(); } + + private final TreeClassLoader classloader; + public synchronized ClassLoader getClassLoader() { return classloader; } + public Loader(String path) { this(path, Loader.class.getClassLoader()); } + public Loader(String path, ClassLoader parent) { super(path); classloader = new TreeClassLoader(this, parent); } + public void changed(Watched w) { /*FIXME*/ } private void fill(Vec vec, File dir) { if (!dir.exists()) return; @@ -35,158 +33,32 @@ public class Loader extends Watcher { fill(vec, new File(dir.getAbsolutePath() + File.separatorChar + list[i])); } } - private void compileSource() throws Exception { - File srcdir = new File(this.path + File.separatorChar + "SRC"); - if (!srcdir.exists()) return; - if (new File("/usr/bin/jikes").exists()) { - File bindir = new File(this.path + File.separatorChar + "BIN"); bindir.mkdirs(); - File libdir = new File(this.path + File.separatorChar + "LIB"); - String classpath = System.getProperty("java.class.path"); - String [] l = new File("/jinetd/LIB/").list(); - for(int i=0; i 0) { + Log.warn(this, " annoying threads:"); + Thread[] annoying = new Thread[tg.activeCount()]; + tg.enumerate(annoying, true); + for(int i=0; i