In my application, I have a static class (singleton) that needs to be initialized with some environment variables that are used through my layers, I call it my applicationContext. This, in turn, has client and user contexts.
As each task completes, it changes these client and user contexts depending on the situation. The problem is that when 2 tasks are triggered at the same time, they can rewrite each other’s contexts, so I need to maintain several user and client contexts for each task to be performed, and I need to be able to choose the appropriate context in order to somehow see what it is current work.
Is there any way to get information about the current work being done by quartz.net?
I imagine something like this where "currentQuartzJob.Name" is composed and is the part that I am missing:
public class MyContextImpl : IApplicationContext { private Dictionary<string,subContexts> allCustomerContexts; public string CurrentContext { get { return allCustomerContexts[currentQuartzJob.Name] }; }
}
edit:
I do not think it is possible to do what I wanted to be able to get the name of the executable job in a class that does not know about Quartz.Net.
What I really need is a way to keep a different context for each job. I managed to do this by looking at the identifier of the executable thread, since they seem to be different for each task that is performed.
source share