开发者

how to set a name for a TriggerListener?

i couldn't find the method that sets the triggerListener name. but i get the Exception:

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)]

but then i figured it out, i added a name variable along with a setter method for it:

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;
}

@Ove开发者_C百科rride
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;
}

i just wanna know what are the exact configuration inside the quartz properties that will match my code because now i am initializing and adding the listener from inside the application and i want this configuration to be initialized on deploy time anytime the ear file is changed, same way as the rest of the configuration are initialized.


i figured it out: org.quartz.triggerListener.NAME.class=wavemark.interfaceserver.interfaceengine.a‌​ction.EngineListener org.quartz.triggerListener.NAME.name=InterfaceSchedulerListener

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜