Class GroovyScript
- java.lang.Object
-
- jenkins.security.MasterToSlaveCallable<Object,RuntimeException>
-
- org.jenkinsci.plugins.scriptler.util.GroovyScript
-
- All Implemented Interfaces:
hudson.remoting.Callable<Object,RuntimeException>
,Serializable
,org.jenkinsci.remoting.RoleSensitive
public class GroovyScript extends MasterToSlaveCallable<Object,RuntimeException>
Inspired by hudson.util.RemotingDiagnostics.Script, but adding parameters.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GroovyScript(String script, Collection<Parameter> parameters, boolean failWithException, TaskListener listener)
ConstructorGroovyScript(String script, Collection<Parameter> parameters, boolean failWithException, TaskListener listener, Launcher launcher, AbstractBuild<?,?> build)
This constructor can only be used when the script is executed on the master, because launcher and build can not be transered to a slave and the therefore the execution will fail
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
call()
void
checkRoles(org.jenkinsci.remoting.RoleChecker roleChecker)
ClassLoader
getClassLoader()
-
-
-
Constructor Detail
-
GroovyScript
public GroovyScript(String script, @NonNull Collection<Parameter> parameters, boolean failWithException, TaskListener listener, Launcher launcher, AbstractBuild<?,?> build)
This constructor can only be used when the script is executed on the master, because launcher and build can not be transered to a slave and the therefore the execution will fail- Parameters:
script
- the script to be executedparameters
- the parameters to be passed to the scriptfailWithException
- should the job fail with an exceptionlistener
- access to logging via listenerlauncher
- the launcherbuild
- the current build
-
GroovyScript
public GroovyScript(String script, @NonNull Collection<Parameter> parameters, boolean failWithException, TaskListener listener)
Constructor- Parameters:
script
- the script to be executedparameters
- the parameters to be passed to the scriptfailWithException
- should the job fail with an exceptionlistener
- access to logging via listener
-
-
Method Detail
-
getClassLoader
public ClassLoader getClassLoader()
-
call
public Object call()
-
checkRoles
public void checkRoles(org.jenkinsci.remoting.RoleChecker roleChecker) throws SecurityException
- Specified by:
checkRoles
in interfaceorg.jenkinsci.remoting.RoleSensitive
- Overrides:
checkRoles
in classMasterToSlaveCallable<Object,RuntimeException>
- Throws:
SecurityException
-
-