Skip to content

Commit

Permalink
add 'boolean running()' to QuartzJobSupport
Browse files Browse the repository at this point in the history
  • Loading branch information
ar committed Jul 22, 2016
1 parent ca81430 commit 2c98035
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions modules/quartz/src/main/java/org/jpos/q2/QuartzAdaptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,9 @@ public String getRealm() {
public Logger getLogger() {
return logger;
}

public boolean running() {
return QuartzAdaptor.this.running();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public abstract class QuartzJobSupport implements Job, Configurable, Runnable {
Configuration cfg;
JobExecutionContext executionContext;
Log log;
QuartzAdaptor.Q2Adaptor adaptor;

public QuartzJobSupport() {
super();
Expand Down Expand Up @@ -63,7 +64,7 @@ public void execute (JobExecutionContext ctx) throws JobExecutionException {
Object o = ctx.getJobDetail().getJobDataMap().get("Q2");
try {
if (o instanceof QuartzAdaptor.Q2Adaptor) {
QuartzAdaptor.Q2Adaptor adaptor = (QuartzAdaptor.Q2Adaptor) o;
adaptor = (QuartzAdaptor.Q2Adaptor) o;
log = new Log(adaptor.getLogger(), adaptor.getRealm());
setConfiguration(adaptor.getConfiguration());
}
Expand All @@ -72,4 +73,7 @@ public void execute (JobExecutionContext ctx) throws JobExecutionException {
getLog().warn(e);
}
}
public boolean running() {
return adaptor == null || adaptor.running();
}
}

0 comments on commit 2c98035

Please # to comment.