multithreading - How to share an Object Reference using Java Spring's Scheduled Task? -


I have an object that is used for storing jdbc connections. In simple, this object works as a JDBC connection pool manager. I have several quartz jobs and many schedulers that are configured with reference to spring applications. I want to be able to share this object reference with each object. This object is set with thread synchronized methods for security. I also have the establishment of each job to continue the data after the execution.

I know that JobTatamap can be used only for primitives and strings, and it does not look like an option. I want to be able to create this object. Then I want to pass the object reference for each task. Each of the concurrent jobs will share this context. This prevents the unique object context for every job.

Where can I see this goal fulfilled? Is this something completely outside the Quartz / Spring area?

Thank you

First and foremost, I made a big mistake I quartz Secondly, I was able to accomplish this by using bean with AutoWire.

Actually, each of my "jobs" or works has the following:

  @Autowired MyCustomDBConnPoolManager MGR;  

For the actual class code for MyCustomDBConnPoolManager

  @ service ("database manager") public class MyCustomDBConnPoolManager { 
< P> Instant my reference

  ApplicationContext appContext = newFileSystemXmlApplicationContext ("applicationContext.xml"); MyCustomDBConnPoolManager Manager = appContext.getBean ("Database Manager"); Manager.initialize ();  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -