returns Constructors, this allows easy instantiation of the class using up to 4 constructor arguments.
returns Constructors, this allows easy instantiation of the class using up to 4 constructor arguments.
Constructors returned by this method are linked to the current codeversion. This means that, if codeversion is refreshed, a call to this will return an up to date Constructors instance. But also it means that the returned constructor will always create instances of that codeversion and will not reflect updates to the codeversion.
please make sure outputDir is valid!!! If you used one of the factory methods to create an instance of the script engine, the output dir will be in the tmp directory.
returns the Class[T] for className
returns the Class[T] for className
Can throw ClassNotFoundException if the class is not present. Can throw ClassCastException if the class is not of T Can trigger a compilation in the background or foreground, depending on the refresh policy.
the full class name
true if the scala file was modified since the last compilation
returns a new instance of className.
returns a new instance of className. The new instance is always of the latest codeversion.
The implementation of the script engine.
The engine works by refreshing the codeVersion. This means that, when the refresh() function is called and provided that the source files have changed, a compilation will be triggered. When the compilation is complete, a new codeVersion will be created and will be used till the next refresh.
This can be initialized standalone or by mixing in a refresh policy trait. If standalone, then refresh() should be manually invoked every time a change occurs in the source code.
If mixed in with a refresh policy, then the policy takes care of scanning the source code for changes and refreshing. Please check RefreshPolicies.scala
Typically this class will not be instantiated using 'new' but rather using one of the factory methods of the companion object. Instantiation offers the full amount of options that can be used by mixing in the various refresh policies and enhancers.
val sse = new ScalaScriptEngine(Config( Set(sourceDir), compilationClassPath, runtimeClasspath, outputDir)) with RefreshAsynchronously with FromClasspathFirst { val recheckEveryMillis: Long = 1000 // each file will only be checked maximum once per second }))