package jenkins.python.expoint; import hudson.ExtensionPoint; import hudson.Util; import hudson.DescriptorExtensionList; import hudson.Extension; import hudson.model.*; import hudson.model.Queue.*; import hudson.util.DescriptorList; import java.util.Collections; import java.util.HashMap; import jenkins.model.Jenkins; import org.kohsuke.stapler.DataBoundConstructor; import java.util.logging.Level; import java.util.logging.Logger; import hudson.slaves.*; import hudson.slaves.RetentionStrategy.*; import hudson.model.AbstractDescribableImpl.*; import jenkins.python.DataConvertor; import jenkins.python.PythonExecutor; /** * This class was automatically generated by the PWM tool on 2014/03/21. * @see hudson.slaves.RetentionStrategy */ public abstract class RetentionStrategyPW<T extends Computer> extends RetentionStrategy<T> { private transient PythonExecutor pexec; private void initPython() { if (pexec == null) { pexec = new PythonExecutor(this); String[] jMethods = new String[1]; jMethods[0] = "check"; String[] pFuncs = new String[1]; pFuncs[0] = "check"; Class[][] argTypes = new Class[1][]; argTypes[0] = new Class[1]; argTypes[0][0] = null; pexec.checkAbstrMethods(jMethods, pFuncs, argTypes); String[] functions = new String[3]; functions[0] = "is_manual_launch_allowed"; functions[1] = "start"; functions[2] = "get_descriptor"; int[] argsCount = new int[3]; argsCount[0] = 1; argsCount[1] = 1; argsCount[2] = 0; pexec.registerFunctions(functions, argsCount); } } @Override public long check(T c) { initPython(); return pexec.execPythonLong("check", c); } @Override public boolean isManualLaunchAllowed(T c) { initPython(); if (pexec.isImplemented(0)) { return pexec.execPythonBool("is_manual_launch_allowed", c); } else { return super.isManualLaunchAllowed(c); } } @Override public void start(T c) { initPython(); if (pexec.isImplemented(1)) { pexec.execPythonVoid("start", c); } else { super.start(c); } } @Override public Descriptor<RetentionStrategy<?>> getDescriptor() { initPython(); if (pexec.isImplemented(2)) { return (Descriptor) pexec.execPython("get_descriptor"); } else { return super.getDescriptor(); } } public boolean superIsManualLaunchAllowed(T c) { return super.isManualLaunchAllowed(c); } public void superStart(T c) { super.start(c); } public Descriptor<RetentionStrategy<?>> superGetDescriptor() { return super.getDescriptor(); } public Object execPython(String function, Object... params) { initPython(); return pexec.execPython(function, params); } public byte execPythonByte(String function, Object... params) { initPython(); return pexec.execPythonByte(function, params); } public short execPythonShort(String function, Object... params) { initPython(); return pexec.execPythonShort(function, params); } public char execPythonChar(String function, Object... params) { initPython(); return pexec.execPythonChar(function, params); } public int execPythonInt(String function, Object... params) { initPython(); return pexec.execPythonInt(function, params); } public long execPythonLong(String function, Object... params) { initPython(); return pexec.execPythonLong(function, params); } public float execPythonFloat(String function, Object... params) { initPython(); return pexec.execPythonFloat(function, params); } public double execPythonDouble(String function, Object... params) { initPython(); return pexec.execPythonDouble(function, params); } public boolean execPythonBool(String function, Object... params) { initPython(); return pexec.execPythonBool(function, params); } public void execPythonVoid(String function, Object... params) { initPython(); pexec.execPythonVoid(function, params); } }