package jenkins.python.expoint; import hudson.DependencyRunner; import hudson.DependencyRunner.ProjectRunnable; import hudson.DescriptorExtensionList; import hudson.Extension; import hudson.ExtensionPoint; import hudson.init.Initializer; import hudson.model.AbstractProject; import hudson.model.Action; import hudson.model.AperiodicWork; import hudson.model.Build; import hudson.model.ComputerSet; import hudson.model.Describable; import hudson.scheduler.Hash; import jenkins.model.Jenkins; import hudson.model.Item; import hudson.model.PeriodicWork; import hudson.model.Project; import hudson.model.TopLevelItem; import hudson.model.TopLevelItemDescriptor; import hudson.scheduler.CronTab; import hudson.scheduler.CronTabList; import hudson.util.DoubleLaunchChecker; import java.io.InvalidObjectException; import java.io.ObjectStreamException; import java.util.ArrayList; import java.util.Calendar; import java.util.Collection; import java.util.Collections; import java.util.Date; import java.util.GregorianCalendar; import java.util.List; import java.util.Timer; import java.util.concurrent.Future; import java.util.logging.Level; import java.util.logging.Logger; import antlr.ANTLRException; import javax.annotation.CheckForNull; import hudson.triggers.*; import hudson.triggers.Trigger.*; import jenkins.python.DataConvertor; import jenkins.python.PythonExecutor; /** * This class was automatically generated by the PWM tool on 2014/03/21. * @see hudson.triggers.Trigger */ public abstract class TriggerPW<J extends Item> extends Trigger<J> { 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[7]; functions[0] = "start"; functions[1] = "run"; functions[2] = "stop"; functions[3] = "get_project_action"; functions[4] = "get_project_actions"; functions[5] = "get_descriptor"; functions[6] = "read_resolve"; int[] argsCount = new int[7]; argsCount[0] = 2; argsCount[1] = 0; argsCount[2] = 0; argsCount[3] = 0; argsCount[4] = 0; argsCount[5] = 0; argsCount[6] = 0; pexec.registerFunctions(functions, argsCount); } } public TriggerPW(String cronTabSpec) throws ANTLRException { super(cronTabSpec); } public TriggerPW() { super(); } @Override public void start(J project, boolean newInstance) { initPython(); if (pexec.isImplemented(0)) { pexec.execPythonVoid("start", project, DataConvertor.fromBool(newInstance)); } else { super.start(project, newInstance); } } @Override public void run() { initPython(); if (pexec.isImplemented(1)) { pexec.execPythonVoid("run"); } else { super.run(); } } @Override public void stop() { initPython(); if (pexec.isImplemented(2)) { pexec.execPythonVoid("stop"); } else { super.stop(); } } @Override public Action getProjectAction() { initPython(); if (pexec.isImplemented(3)) { return (Action) pexec.execPython("get_project_action"); } else { return super.getProjectAction(); } } @Override public Collection<? extends Action> getProjectActions() { initPython(); if (pexec.isImplemented(4)) { return (Collection) pexec.execPython("get_project_actions"); } else { return super.getProjectActions(); } } @Override public TriggerDescriptor getDescriptor() { initPython(); if (pexec.isImplemented(5)) { return (TriggerDescriptor) pexec.execPython("get_descriptor"); } else { return super.getDescriptor(); } } @Override public Object readResolve() throws ObjectStreamException { initPython(); if (pexec.isImplemented(6)) { return (Object) pexec.execPython("read_resolve"); } else { return super.readResolve(); } } public void superStart(J project, boolean newInstance) { super.start(project, newInstance); } public void superRun() { super.run(); } public void superStop() { super.stop(); } public Action superGetProjectAction() { return super.getProjectAction(); } public Collection<? extends Action> superGetProjectActions() { return super.getProjectActions(); } public TriggerDescriptor superGetDescriptor() { return super.getDescriptor(); } public Object superReadResolve() throws ObjectStreamException { return super.readResolve(); } 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); } }