I use ThreadSafeList and I get a lot of mileage from it for streaming data from a process to a web server, and then streaming data output when it arrives at the client. In memory, I store data in the JVM using Spring Caching (ehcache under the hood), and all is well. The problem started when I started clicking on the edges of heaps and Spring. Caching has begun serializing my ThreadSafeList to disk while I use it, calling ConcurrentModificationExceptions. Can I overwrite the private writeObject and readObject methods for the Serialization interface to solve the problem? I am not sure how to do this, or if I should give up my ThreadSafeList.
When I started this program, I used BlockingDeque, but that was not enough, because when I added and accepted the structure, I could not remember the data for caching ... I can not use ConcurrentMap because I need to order from my list. .. should I go for ConcurrentNavigableMap? I feel like I'm skating on my own with ThreadSafeList, and may custom serialization functions be unnecessary?
Java Code Geeks ThreadSafeList
source share