Write a singleton service class. The service class has two member variables, one is the file handle and the other is the stream, which can be get and set. Use it as a bean of spring, and inject this bean into both quartz and your reading and writing threads. In quartz, set is used to change handles and streams, and read and write threads use get to read
Write a singleton service class. The service class has two member variables, one is the file handle and the other is the stream, which can be get and set. Use it as a bean of spring, and inject this bean into both quartz and your reading and writing threads. In quartz, set is used to change handles and streams, and read and write threads use get to read