开发者

how to set a name for a TriggerListener?

开发者 https://www.devze.com 2023-03-14 05:24 出处:网络
i couldn\'t find the method that sets the triggerListener name. but i get the Exception: org.quartz.SchedulerException: TriggerListener \'wavemark.interfaceserver.interfaceengine.action.EngineListene

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

精彩评论

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

关注公众号