IWETHEY v. 0.3.0 | TODO
1,095 registered users | 1 active user | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Using Java Serialization?
If so, I'd consider subclassing ObjectOutputStream on the client and overriding readObject to call super to read the object, look it up in your cache, then return the cached object if found - otherwise entering this one into the cache and returning that.

That should solve your problem.



"One of the main causes of the fall of the Roman Empire was that,
lacking zero, they had no way to indicate successful termination
of their C programs."
-- Robert Firth
New Re: Using Java Serialization?
If so, I'd consider subclassing ObjectOutputStream on the client and overriding readObject to call super to read the object, look it up in your cache, then return the cached object if found - otherwise entering this one into the cache and returning that.

Yup, except I'm implementing the readResolve method. This allows me to replace the object that's being deserialized during deserialization. I've got a simple "Registry" that uses HashMaps to cache data. I was hoping there were some more robust options already out there. If not, what I've got should work.

Thanks,
John
     Caching Java Client Objects in 3 tier system - (johnu) - (4)
         Re: Caching Java Client Objects in 3 tier system - (tuberculosis) - (3)
             Re: Caching Java Client Objects in 3 tier system - (johnu) - (2)
                 Using Java Serialization? - (tuberculosis) - (1)
                     Re: Using Java Serialization? - (johnu)

Sheer, unadultered, industrial-strength tinfoil-helmet alien-lizard-people drivel of the first degree.
58 ms