Skip to content

Commit

Permalink
AutoConfigure Quartz Jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
ar committed Dec 29, 2021
1 parent d7c878e commit 619ba38
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public void execute (JobExecutionContext ctx) throws JobExecutionException {
if (o instanceof QuartzAdaptor.Q2Adaptor) {
adaptor = (QuartzAdaptor.Q2Adaptor) o;
log = new Log(adaptor.getLogger(), adaptor.getRealm());
QFactory.autoconfigure(this, adaptor.getConfiguration());
setConfiguration(adaptor.getConfiguration());
}
run();
Expand Down
7 changes: 6 additions & 1 deletion modules/quartz/src/main/java/org/jpos/q2/TestJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@

package org.jpos.q2;

import org.jpos.core.annotation.Config;

public class TestJob extends QuartzJobSupport {
@Config("message")
private String message;

public void run() {
getLog().info(cfg.get ("message"));
getLog().info(message);
}
}

0 comments on commit 619ba38

Please sign in to comment.