-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMonitorFactory.java
More file actions
35 lines (31 loc) · 1.04 KB
/
MonitorFactory.java
File metadata and controls
35 lines (31 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import java.lang.management.ClassLoadingMXBean;
import java.net.URL;
import java.net.URLClassLoader;
import org.omg.CORBA.PRIVATE_MEMBER;
public class MonitorFactory {
private static final String CLASS_FOLDER = util.MONITOR_PATH;
public static Class getClassFromFile(String MonitorName) throws Exception {
URLClassLoader loader = new URLClassLoader(new URL[] {
new URL("file://"+ CLASS_FOLDER)
});
return loader.loadClass(MonitorName);
}
// public static Object GetInstance (String MonitorName) throws Exception {
// Class myClass = getClassFromFile(MonitorName);
// return myClass.newInstance();
// }
//
}
//private static final String CLASS_FOLDER =
//"/Users/juneyoungoh/Downloads/";
//
//private static Class getClassFromFile(String fullClassName) throws Exception {
//URLClassLoader loader = new URLClassLoader(new URL[] {
// new URL("file://" + CLASS_FOLDER)
//});
//return loader.loadClass(fullClassName);
//}
//
//public static void main( String[] args ) throws Exception {
//System.out.println((getClassFromFile("ClassFile"));
//}