Skip to content

Commit ba4e7eb

Browse files
committed
fixup! refactor: splits modern and compat Graal implementations.
1 parent 6be37a1 commit ba4e7eb

File tree

2 files changed

+58
-2
lines changed

2 files changed

+58
-2
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* Copyright (c) 2016-2021.
3+
*
4+
* This file is part of Imposter.
5+
*
6+
* "Commons Clause" License Condition v1.0
7+
*
8+
* The Software is provided to you by the Licensor under the License, as
9+
* defined below, subject to the following condition.
10+
*
11+
* Without limiting other conditions in the License, the grant of rights
12+
* under the License will not include, and the License does not grant to
13+
* you, the right to Sell the Software.
14+
*
15+
* For purposes of the foregoing, "Sell" means practicing any or all of
16+
* the rights granted to you under the License to provide to third parties,
17+
* for a fee or other consideration (including without limitation fees for
18+
* hosting or consulting/support services related to the Software), a
19+
* product or service whose value derives, entirely or substantially, from
20+
* the functionality of the Software. Any license notice or attribution
21+
* required by the License must also include this Commons Clause License
22+
* Condition notice.
23+
*
24+
* Software: Imposter
25+
*
26+
* License: GNU Lesser General Public License version 3
27+
*
28+
* Licensor: Peter Cornish
29+
*
30+
* Imposter is free software: you can redistribute it and/or modify
31+
* it under the terms of the GNU Lesser General Public License as published by
32+
* the Free Software Foundation, either version 3 of the License, or
33+
* (at your option) any later version.
34+
*
35+
* Imposter is distributed in the hope that it will be useful,
36+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
37+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38+
* GNU Lesser General Public License for more details.
39+
*
40+
* You should have received a copy of the GNU Lesser General Public License
41+
* along with Imposter. If not, see <https://www.gnu.org/licenses/>.
42+
*/
43+
package io.gatehill.imposter.scripting.graalvm
44+
45+
import com.google.inject.AbstractModule
46+
import com.google.inject.Singleton
47+
import io.gatehill.imposter.scripting.graalvm.service.GraalvmCompatScriptServiceImpl
48+
49+
/**
50+
* @author Pete Cornish
51+
*/
52+
class GraalvmCompatScriptingModule : AbstractModule() {
53+
override fun configure() {
54+
bind(GraalvmCompatScriptServiceImpl::class.java).`in`(Singleton::class.java)
55+
}
56+
}

scripting/graalvm/src/main/java/io/gatehill/imposter/scripting/graalvm/service/GraalvmCompatScriptServiceImpl.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import io.gatehill.imposter.script.ReadWriteResponseBehaviour
5151
import io.gatehill.imposter.script.RuntimeContext
5252
import io.gatehill.imposter.script.dsl.Dsl
5353
import io.gatehill.imposter.scripting.common.util.JavaScriptUtil
54-
import io.gatehill.imposter.scripting.graalvm.GraalvmScriptingModule
54+
import io.gatehill.imposter.scripting.graalvm.GraalvmCompatScriptingModule
5555
import io.gatehill.imposter.service.ScriptService
5656
import io.gatehill.imposter.service.ScriptSource
5757
import org.apache.logging.log4j.LogManager
@@ -66,7 +66,7 @@ import javax.script.SimpleBindings
6666
* @author Pete Cornish
6767
*/
6868
@PluginInfo("js-graal-compat")
69-
@RequireModules(GraalvmScriptingModule::class)
69+
@RequireModules(GraalvmCompatScriptingModule::class)
7070
class GraalvmCompatScriptServiceImpl : ScriptService, Plugin {
7171
private val scriptEngine: ScriptEngine
7272

0 commit comments

Comments
 (0)