开发者

Is there any way to avoid putting business logic in Execute method and define say 4 functions for different business logics

开发者 https://www.devze.com 2023-03-09 15:05 出处:网络
Is there any way to define say 4 functions in our job class (w开发者_JS百科hich implements the IJob interface) and use them dynamically in quartz_jobs.xml file.

Is there any way to define say 4 functions in our job class (w开发者_JS百科hich implements the IJob interface) and use them dynamically in quartz_jobs.xml file.

Right now the only way is to put business logic in the Execute method. But I want to define my own methods and use that name in <job-type> tag. Like say I defined 2 methods SendMail1() and SendMail2() and no execute method is there in my job class. Now I want to call it like:

<job-type>
    ClassLibrary1.Class1.SendMail1, ClassLibrary1
</job-type>

Requirement is urgent. If anybody has any idea, please send it.

Thanks in advance, Akki J


Add additional methods to your class as you describe.

In your Execute method use one of your job data values to determine which other method to call.

0

精彩评论

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

关注公众号