summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/jenkinsci/plugins/activemq/ActiveMqBuildTrigger.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/java/org/jenkinsci/plugins/activemq/ActiveMqBuildTrigger.java b/src/main/java/org/jenkinsci/plugins/activemq/ActiveMqBuildTrigger.java
index f3a2a79..9f9c6a6 100644
--- a/src/main/java/org/jenkinsci/plugins/activemq/ActiveMqBuildTrigger.java
+++ b/src/main/java/org/jenkinsci/plugins/activemq/ActiveMqBuildTrigger.java
@@ -1,13 +1,12 @@
package org.jenkinsci.plugins.activemq;
import hudson.Extension;
+import hudson.model.AbstractProject;
import hudson.model.BuildableItem;
import hudson.model.Item;
import hudson.triggers.Trigger;
import hudson.triggers.TriggerDescriptor;
-import hudson.util.FormValidation;
import org.kohsuke.stapler.DataBoundConstructor;
-import org.kohsuke.stapler.QueryParameter;
import org.mvel2.MVEL;
import org.slf4j.Logger;
@@ -20,7 +19,7 @@ import static org.jenkinsci.plugins.activemq.ActiveMqClient.BuildRequest;
import static org.mvel2.MVEL.compileExpression;
import static org.slf4j.LoggerFactory.getLogger;
-public class ActiveMqBuildTrigger extends Trigger<BuildableItem> {
+public class ActiveMqBuildTrigger extends Trigger<AbstractProject> {
private static final Logger log = getLogger(ActiveMqBuildTrigger.class);
@@ -28,10 +27,15 @@ public class ActiveMqBuildTrigger extends Trigger<BuildableItem> {
private transient Serializable compiledMvel;
- // parameters['jobName'] == 'fast-build'
@DataBoundConstructor
public ActiveMqBuildTrigger(String mvel) {
log.info("ActiveMqBuildTrigger.ActiveMqBuildTrigger");
+ }
+
+ @Override
+ public void start(AbstractProject project, boolean newInstance) {
+ super.start(project, newInstance);
+ log.info("ActiveMqBuildTrigger.start");
setMvel_(mvel);
}
@@ -43,6 +47,7 @@ public class ActiveMqBuildTrigger extends Trigger<BuildableItem> {
private void setMvel_(String mvel) {
mvel = trimToNull(mvel);
if (mvel == null) {
+ log.info("ActiveMqBuildTrigger.setMvel_: mvel is null");
this.mvel = null;
this.compiledMvel = null;
return;
@@ -51,6 +56,7 @@ public class ActiveMqBuildTrigger extends Trigger<BuildableItem> {
try {
compiledMvel = compileExpression(mvel);
this.mvel = mvel;
+ log.info("ActiveMqBuildTrigger.setMvel_: mvel={}", mvel);
} catch (Exception e) {
log.warn("Unable to compile MVEL", e);
}