本文整理汇总了Java中org.quartz.JobListener.getName方法的典型用法代码示例。如果您正苦于以下问题:Java JobListener.getName方法的具体用法?Java JobListener.getName怎么用?Java JobListener.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.quartz.JobListener
的用法示例。
在下文中一共展示了JobListener.getName方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addJobListener
import org.quartz.JobListener; //导入方法依赖的package包/类
public void addJobListener(JobListener jobListener, List<Matcher<JobKey>> matchers) {
if (jobListener.getName() == null || jobListener.getName().length() == 0) {
throw new IllegalArgumentException(
"JobListener name cannot be empty.");
}
synchronized (globalJobListeners) {
globalJobListeners.put(jobListener.getName(), jobListener);
LinkedList<Matcher<JobKey>> matchersL = new LinkedList<Matcher<JobKey>>();
if(matchers != null && matchers.size() > 0)
matchersL.addAll(matchers);
else
matchersL.add(EverythingMatcher.allJobs());
globalJobListenersMatchers.put(jobListener.getName(), matchersL);
}
}
示例2: notifyJobListenersToBeExecuted
import org.quartz.JobListener; //导入方法依赖的package包/类
public void notifyJobListenersToBeExecuted(JobExecutionContext jec)
throws SchedulerException {
// build a list of all job listeners that are to be notified...
List<JobListener> jobListeners = buildJobListenerList();
// notify all job listeners
for(JobListener jl: jobListeners) {
try {
if(!matchJobListener(jl, jec.getJobDetail().getKey()))
continue;
jl.jobToBeExecuted(jec);
} catch (Exception e) {
SchedulerException se = new SchedulerException(
"JobListener '" + jl.getName() + "' threw exception: "
+ e.getMessage(), e);
throw se;
}
}
}
示例3: notifyJobListenersWasVetoed
import org.quartz.JobListener; //导入方法依赖的package包/类
public void notifyJobListenersWasVetoed(JobExecutionContext jec)
throws SchedulerException {
// build a list of all job listeners that are to be notified...
List<JobListener> jobListeners = buildJobListenerList();
// notify all job listeners
for(JobListener jl: jobListeners) {
try {
if(!matchJobListener(jl, jec.getJobDetail().getKey()))
continue;
jl.jobExecutionVetoed(jec);
} catch (Exception e) {
SchedulerException se = new SchedulerException(
"JobListener '" + jl.getName() + "' threw exception: "
+ e.getMessage(), e);
throw se;
}
}
}
示例4: notifyJobListenersWasExecuted
import org.quartz.JobListener; //导入方法依赖的package包/类
public void notifyJobListenersWasExecuted(JobExecutionContext jec,
JobExecutionException je) throws SchedulerException {
// build a list of all job listeners that are to be notified...
List<JobListener> jobListeners = buildJobListenerList();
// notify all job listeners
for(JobListener jl: jobListeners) {
try {
if(!matchJobListener(jl, jec.getJobDetail().getKey()))
continue;
jl.jobWasExecuted(jec, je);
} catch (Exception e) {
SchedulerException se = new SchedulerException(
"JobListener '" + jl.getName() + "' threw exception: "
+ e.getMessage(), e);
throw se;
}
}
}
示例5: notifyJobListenersToBeExecuted
import org.quartz.JobListener; //导入方法依赖的package包/类
public void notifyJobListenersToBeExecuted(JobExecutionContext jec)
throws SchedulerException {
// build a list of all job listeners that are to be notified...
List jobListeners = buildJobListenerList(jec.getJobDetail()
.getJobListenerNames());
// notify all job listeners
java.util.Iterator itr = jobListeners.iterator();
while (itr.hasNext()) {
JobListener jl = (JobListener) itr.next();
try {
jl.jobToBeExecuted(jec);
} catch (Exception e) {
SchedulerException se = new SchedulerException(
"JobListener '" + jl.getName() + "' threw exception: "
+ e.getMessage(), e);
se.setErrorCode(SchedulerException.ERR_JOB_LISTENER);
throw se;
}
}
}
示例6: notifyJobListenersWasVetoed
import org.quartz.JobListener; //导入方法依赖的package包/类
public void notifyJobListenersWasVetoed(JobExecutionContext jec)
throws SchedulerException {
// build a list of all job listeners that are to be notified...
List jobListeners = buildJobListenerList(jec.getJobDetail()
.getJobListenerNames());
// notify all job listeners
java.util.Iterator itr = jobListeners.iterator();
while (itr.hasNext()) {
JobListener jl = (JobListener) itr.next();
try {
jl.jobExecutionVetoed(jec);
} catch (Exception e) {
SchedulerException se = new SchedulerException(
"JobListener '" + jl.getName() + "' threw exception: "
+ e.getMessage(), e);
se.setErrorCode(SchedulerException.ERR_JOB_LISTENER);
throw se;
}
}
}
示例7: addInternalJobListener
import org.quartz.JobListener; //导入方法依赖的package包/类
/**
* <p>
* Add the given <code>{@link org.quartz.JobListener}</code> to the
* <code>Scheduler</code>'s <i>internal</i> list.
* </p>
*/
public void addInternalJobListener(JobListener jobListener) {
if (jobListener.getName() == null
|| jobListener.getName().length() == 0) {
throw new IllegalArgumentException(
"JobListener name cannot be empty.");
}
synchronized (internalJobListeners) {
internalJobListeners.put(jobListener.getName(), jobListener);
}
}
示例8: addGlobalJobListener
import org.quartz.JobListener; //导入方法依赖的package包/类
/**
* <p>
* Add the given <code>{@link org.quartz.JobListener}</code> to the
* <code>Scheduler</code>'s<i>global</i> list.
* </p>
*
* <p>
* Listeners in the 'global' list receive notification of execution events
* for ALL <code>{@link org.quartz.Job}</code>s.
* </p>
*/
public void addGlobalJobListener(JobListener jobListener) {
if (jobListener.getName() == null
|| jobListener.getName().length() == 0) {
throw new IllegalArgumentException(
"JobListener name cannot be empty.");
}
synchronized (globalJobListeners) {
globalJobListeners.put(jobListener.getName(), jobListener);
}
}
示例9: addJobListener
import org.quartz.JobListener; //导入方法依赖的package包/类
/**
* <p>
* Add the given <code>{@link org.quartz.JobListener}</code> to the
* <code>Scheduler</code>'s list, of registered <code>JobListener</code>s.
*/
public void addJobListener(JobListener jobListener) {
if (jobListener.getName() == null
|| jobListener.getName().length() == 0) {
throw new IllegalArgumentException(
"JobListener name cannot be empty.");
}
synchronized (jobListeners) {
jobListeners.put(jobListener.getName(), jobListener);
}
}
示例10: notifyJobListenersWasExecuted
import org.quartz.JobListener; //导入方法依赖的package包/类
public void notifyJobListenersWasExecuted(JobExecutionContext jec,
JobExecutionException je) throws SchedulerException {
// build a list of all job listeners that are to be notified...
List jobListeners = buildJobListenerList(jec.getJobDetail()
.getJobListenerNames());
// notify all job listeners
java.util.Iterator itr = jobListeners.iterator();
while (itr.hasNext()) {
JobListener jl = (JobListener) itr.next();
try {
jl.jobWasExecuted(jec, je);
} catch (Exception e) {
SchedulerException se = new SchedulerException(
"JobListener '" + jl.getName() + "' threw exception: "
+ e.getMessage(), e);
se.setErrorCode(SchedulerException.ERR_JOB_LISTENER);
throw se;
}
}
}