diff --git a/core/pom.xml b/core/pom.xml
index ef3e850f7dd..7a67dc27dc8 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -150,6 +150,11 @@
org.apache.commonscommons-lang3
+
+ org.python
+ jython
+ 2.7.0
+ org.testng
diff --git a/core/src/main/java/org/apache/brooklyn/core/effector/script/ScriptEffector.java b/core/src/main/java/org/apache/brooklyn/core/effector/script/ScriptEffector.java
new file mode 100644
index 00000000000..904b3ac3fc5
--- /dev/null
+++ b/core/src/main/java/org/apache/brooklyn/core/effector/script/ScriptEffector.java
@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.core.effector.script;
+
+import java.util.Map;
+
+import javax.script.ScriptContext;
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
+import javax.script.ScriptException;
+import javax.script.SimpleScriptContext;
+
+import org.python.core.Options;
+
+import com.google.common.base.Preconditions;
+import com.google.common.reflect.TypeToken;
+
+import org.apache.brooklyn.api.effector.Effector;
+import org.apache.brooklyn.api.effector.ParameterType;
+import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.ConfigKeys;
+import org.apache.brooklyn.core.effector.AddEffector;
+import org.apache.brooklyn.core.effector.EffectorBody;
+import org.apache.brooklyn.core.effector.Effectors;
+import org.apache.brooklyn.core.effector.Effectors.EffectorBuilder;
+import org.apache.brooklyn.util.core.ResourceUtils;
+import org.apache.brooklyn.util.core.config.ConfigBag;
+import org.apache.brooklyn.util.core.flags.SetFromFlag;
+import org.apache.brooklyn.util.core.flags.TypeCoercions;
+import org.apache.brooklyn.util.core.task.Tasks;
+import org.apache.brooklyn.util.exceptions.Exceptions;
+import org.apache.brooklyn.util.text.Strings;
+
+public final class ScriptEffector extends AddEffector {
+
+ static {
+ Options.importSite = false;
+ }
+
+ @SetFromFlag("lang")
+ public static final ConfigKey EFFECTOR_SCRIPT_LANGUAGE = ConfigKeys.newStringConfigKey(
+ "script.language", "The scripting language the effector is written in", "JavaScript");
+
+ @SetFromFlag("content")
+ public static final ConfigKey EFFECTOR_SCRIPT_CONTENT = ConfigKeys.newStringConfigKey(
+ "script.content", "The script code to evaluate for the effector");
+
+ @SetFromFlag("script")
+ public static final ConfigKey EFFECTOR_SCRIPT_URL = ConfigKeys.newStringConfigKey(
+ "script.url", "A URL for the script to evaluate for the effector");
+
+ @SetFromFlag("return")
+ public static final ConfigKey EFFECTOR_SCRIPT_RETURN_VAR = ConfigKeys.newStringConfigKey(
+ "script.return.var", "An optional script variable to return from the effector");
+
+ @SetFromFlag("type")
+ public static final ConfigKey> EFFECTOR_SCRIPT_RETURN_TYPE = ConfigKeys.newConfigKey(
+ new TypeToken>() { },
+ "script.return.type", "The type of the return value from the effector", Object.class);
+
+ public ScriptEffector(ConfigBag params) {
+ super(newEffectorBuilder(params).build());
+ }
+
+ public ScriptEffector(Map params) {
+ this(ConfigBag.newInstance(params));
+ }
+
+ public static EffectorBuilder