summaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/modules/blueprint-scripts/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'ms/controllerblueprints/modules/blueprint-scripts/src/main')
-rw-r--r--ms/controllerblueprints/modules/blueprint-scripts/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BluePrintScriptsServiceImpl.kt14
1 files changed, 7 insertions, 7 deletions
diff --git a/ms/controllerblueprints/modules/blueprint-scripts/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BluePrintScriptsServiceImpl.kt b/ms/controllerblueprints/modules/blueprint-scripts/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BluePrintScriptsServiceImpl.kt
index ce1a6b1af..9438c1f4b 100644
--- a/ms/controllerblueprints/modules/blueprint-scripts/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BluePrintScriptsServiceImpl.kt
+++ b/ms/controllerblueprints/modules/blueprint-scripts/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BluePrintScriptsServiceImpl.kt
@@ -30,14 +30,14 @@ import kotlin.script.experimental.jvmhost.createJvmCompilationConfigurationFromT
@Service
open class BluePrintScriptsServiceImpl : BluePrintScriptsService {
- override fun <T> scriptInstance(blueprintContext: BluePrintContext, scriptClassName: String,
- reCompile: Boolean): T {
+ override suspend fun <T> scriptInstance(blueprintContext: BluePrintContext, scriptClassName: String,
+ reCompile: Boolean): T {
val kotlinScriptPath = blueprintContext.rootPath.plus(File.separator)
.plus(BluePrintConstants.TOSCA_SCRIPTS_KOTLIN_DIR)
val compiledJar = kotlinScriptPath.plus(File.separator)
- .plus(getBluePrintScriptsJarName(blueprintContext))
+ .plus(bluePrintScriptsJarName(blueprintContext))
val scriptSource = BluePrintSourceCode()
@@ -59,13 +59,13 @@ open class BluePrintScriptsServiceImpl : BluePrintScriptsService {
return returnValue?.value!! as T
}
- override fun <T> scriptInstance(scriptClassName: String): T {
+ override suspend fun <T> scriptInstance(scriptClassName: String): T {
val args = ArrayList<Any?>()
return Thread.currentThread().contextClassLoader.loadClass(scriptClassName).constructors
.single().newInstance(*args.toArray()) as T
}
-}
-fun getBluePrintScriptsJarName(blueprintContext: BluePrintContext): String {
- return "${blueprintContext.name()}-${blueprintContext.version()}-cba-kts.jar"
+ private fun bluePrintScriptsJarName(blueprintContext: BluePrintContext): String {
+ return "${blueprintContext.name()}-${blueprintContext.version()}-cba-kts.jar"
+ }
} \ No newline at end of file