@ SuppressWarnings ( { "rawtypes" , "unchecked" } ) public void runThread ( Object objJobDef ) { if ( objJobDef instanceof Task ) { Task task = ( Task ) objJobDef ; if ( task . getApplication ( ) == null ) // init()ed yet? task . initTask ( this . getApplication ( ) , null ) ; // No, Initialize it task . run ( ) ; } else if ( ( objJobDef instanceof String ) || ( objJobDef instanceof Properties ) ) { String strJobDef = null ; Map < String , Object > properties = null ; if ( objJobDef instanceof String ) { strJobDef = ( String ) objJobDef ; properties = new Hashtable < String , Object > ( ) ; Util . parseArgs ( properties , strJobDef ) ; } if ( objJobDef instanceof Properties ) properties = ( Map ) objJobDef ; if ( properties . get ( "webStartPropertiesFile" ) != null ) properties = this . addPropertiesFile ( properties ) ; String strClass = ( String ) properties . get ( Param . TASK ) ; if ( strClass == null ) strClass = ( String ) properties . get ( Param . APPLET ) ; // Applets are also run as tasks Object job = ClassServiceUtility . getClassService ( ) . makeObjectFromClassName ( strClass ) ; if ( job instanceof Task ) { ( ( Task ) job ) . initTask ( this . getApplication ( ) , properties ) ; ( ( Task ) job ) . run ( ) ; } else if ( job instanceof Applet ) { // An applet //new JBaseFrame("Applet", (Applet)job); System . out . println ( "********** Applet task type needs to be fixed *********" ) ; } else if ( job instanceof Runnable ) { // A thread (Is this okay?? I already have my own thread) //x new Thread((Runnable)job).start(); // No, don't start another thread ( ( Runnable ) job ) . run ( ) ; // This should be okay, as I already have my own thread } else Util . getLogger ( ) . warning ( "Illegal job type passed to TaskScheduler: " + job ) ; } else if ( objJobDef instanceof Runnable ) ( ( Runnable ) objJobDef ) . run ( ) ; else Util . getLogger ( ) . warning ( "Error: Illegal job type" ) ; }
Start this task running in this thread .