1
我找不到設置triggerListener名稱的方法。 但我得到異常:如何爲TriggerListener設置名稱?
org.quartz.SchedulerException: TriggerListener 'wavemark.interfaceserver.interfaceengine.action.EngineListener'
props could not be configured.
[See nested exception: java.lang.NoSuchMethodException:
wavemark.interfaceserver.interfaceengine.action.EngineListener.setName(java.lang.String)]
但後來我想通了,我加了一個名字變量,它的setter方法一起:
public class EngineListener implements TriggerListener
{
private String name;
public EngineListener()
{
}
public EngineListener(String name)
{
this.name = name;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
@Override
public void triggerComplete(Trigger arg0, JobExecutionContext arg1, int arg2)
{
// TODO Auto-generated method stub
}
@Override
public void triggerFired(Trigger arg0, JobExecutionContext arg1)
{
// TODO Auto-generated method stub
}
@Override
public void triggerMisfired(Trigger arg0)
{
// TODO Auto-generated method stub
}
@Override
public boolean vetoJobExecution(Trigger arg0, JobExecutionContext arg1)
{
return false;
}
我只是想知道什麼是確切配置裏面的石英屬性將匹配我的代碼,因爲現在我正在初始化並從應用程序內部添加偵聽器,並且我希望此配置在部署時被初始化,隨時更改ear文件,與其餘配置初始化相同。
我理解了它: org.quartz.triggerListener.NAME.class = wavemark.interfaceserver.interfaceengine.action.EngineListener org.quartz.triggerListener.NAME.name = InterfaceSchedulerListener – Gilbert