c5ae337620f6ad6404a1c84d24df8bb9446416d3
[org.ibex.jinetd.git] / src / org / ibex / jinetd / Host.java
1 package org.ibex.jinetd;
2 import org.ibex.util.*;
3 import java.io.*;
4 import java.util.*;
5 import java.lang.reflect.*;
6
7 public class Host extends Loader {
8
9     final String hostname;
10     public Host(String path, String hostname) { super(path); this.hostname = hostname; }
11
12     public void changed(Watched w) {
13         super.changed(w);
14         Log.debug(this, "changed(" + w + ")");
15         try {
16             ClassLoader cl = getClassLoader();
17             if (cl == null) return;
18             Class c = cl.loadClass("Main");
19             if (c == null) return;
20             Method m = c.getMethod("main", new Class[] { });
21             m.invoke(null, new Object[] { });
22         } catch (Exception e) {
23             Log.warn(this, "nope");
24         }
25     }
26 }