package jenkins.python.expoint; import hudson.Extension; import hudson.ExtensionList; import hudson.ExtensionPoint; import hudson.model.Queue.Item; import hudson.slaves.Cloud; import jenkins.model.Jenkins; import hudson.model.Node; import hudson.model.Queue; import hudson.model.Queue.BuildableItem; import hudson.model.Queue.Task; import hudson.model.queue.*; import hudson.model.queue.QueueTaskDispatcher.*; import jenkins.python.DataConvertor; import jenkins.python.PythonExecutor; /** * This class was automatically generated by the PWM tool on 2014/03/21. * @see hudson.model.queue.QueueTaskDispatcher */ public abstract class QueueTaskDispatcherPW extends QueueTaskDispatcher { private transient PythonExecutor pexec; private void initPython() { if (pexec == null) { pexec = new PythonExecutor(this); String[] jMethods = new String[0]; String[] pFuncs = new String[0]; Class[][] argTypes = new Class[0][]; pexec.checkAbstrMethods(jMethods, pFuncs, argTypes); String[] functions = new String[3]; functions[0] = "can_take"; functions[1] = "can_take"; functions[2] = "can_run"; int[] argsCount = new int[3]; argsCount[0] = 2; argsCount[1] = 2; argsCount[2] = 1; pexec.registerFunctions(functions, argsCount); } } @Override public CauseOfBlockage canTake(Node node, Task task) { initPython(); if (pexec.isImplemented(0)) { return (CauseOfBlockage) pexec.execPython("can_take", node, task); } else { return super.canTake(node, task); } } @Override public CauseOfBlockage canTake(Node node, BuildableItem item) { initPython(); if (pexec.isImplemented(1)) { return (CauseOfBlockage) pexec.execPython("can_take", node, item); } else { return super.canTake(node, item); } } @Override public CauseOfBlockage canRun(Queue.Item item) { initPython(); if (pexec.isImplemented(2)) { return (CauseOfBlockage) pexec.execPython("can_run", item); } else { return super.canRun(item); } } public CauseOfBlockage superCanTake(Node node, Task task) { return super.canTake(node, task); } public CauseOfBlockage superCanTake(Node node, BuildableItem item) { return super.canTake(node, item); } public CauseOfBlockage superCanRun(Queue.Item item) { return super.canRun(item); } 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); } }