org.knowceans.topics.cgen
Class JitSampler

java.lang.Object
  extended by org.knowceans.topics.cgen.JitSampler

public class JitSampler
extends java.lang.Object

Just-in-time Sampler. From a mixture network representation, writes a Java source file compiles it and executes its main() method, in order to test the general functionality of the class. Stdout and stderr are used for monitoring throughout the process.

Author:
gregor

Nested Class Summary
 class JitSampler.MyClassLoader
          class loader that allows to load a class from an absolute file name.
 
Field Summary
static java.lang.String sourceDir
           
 
Constructor Summary
JitSampler(java.io.File mxnfile)
           
JitSampler(java.lang.String gibbsCode)
           
 
Method Summary
 void compile()
          compile the class
static void main(java.lang.String[] args)
           
 void run()
          try to run the class from its main() method
 void write()
          Write java file for class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sourceDir

public static java.lang.String sourceDir
Constructor Detail

JitSampler

public JitSampler(java.io.File mxnfile)
           throws java.io.IOException
Throws:
java.io.IOException

JitSampler

public JitSampler(java.lang.String gibbsCode)
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

write

public void write()
Write java file for class


compile

public void compile()
compile the class


run

public void run()
         throws java.lang.Exception
try to run the class from its main() method

Throws:
java.lang.Exception