FileDocCategorySizeDatePackage
jdk12CreateThreadRunnableAction.javaAPI DocJMF 2.1.1e1516Mon May 12 12:20:44 BST 2003com.sun.media.util

jdk12CreateThreadRunnableAction

public 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.Objectrun()

	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;
	}