jdk12CreateThreadRunnableActionpublic class jdk12CreateThreadRunnableAction extends Object implements PrivilegedAction
Fields Summary |
---|
private Class | threadclass | private Runnable | runnable | private String | name | public static Constructor | cons | public static Constructor | conswithname |
Constructors Summary |
---|
public jdk12CreateThreadRunnableAction(Class threadclass, Runnable run, String name)
try {
cons = jdk12CreateThreadRunnableAction.class.getConstructor(new Class[] {
Class.class, Runnable.class});
conswithname = jdk12CreateThreadRunnableAction.class.getConstructor(new Class[] {
Class.class, Runnable.class, String.class});
} catch (Throwable e) {
}
try {
this.threadclass = threadclass;
runnable = run;
this.name = name;
} catch (Throwable e) {
}
| public jdk12CreateThreadRunnableAction(Class threadclass, Runnable run)
this(threadclass, run, null);
|
Methods Summary |
---|
public java.lang.Object | run()
try {
Constructor cons = threadclass.getConstructor(new Class[] {Runnable.class});
Object object = cons.newInstance(new Object[] {runnable});
if (name != null) {
((Thread) object).setName(name);
}
return object;
} catch (Throwable e) {
return null;
}
|
|