-
1. Re: How to re-autowire/inject transient fields from Spring/IoC during deserialization?
pmuir Sep 5, 2011 7:31 AM (in response to johncommon)1 of 1 people found this helpfulHow about creating an interceptor do do this. To get the value, call InvocationContext#lookupEntry(key), where you get the key from the command being interceptor (DataCommand#getKey) and can then call CacheEntry#getValue() to get the actual object.
-
2. Re: How to re-autowire/inject transient fields from Spring/IoC during deserialization?
johncommon Sep 19, 2011 9:09 AM (in response to pmuir)Pete,
Thanks for the suggestion! I think using interceptors would work but I think I'd still be left navigating the object graph to find the places that need autowiring. Is that right? Does the interceptor work only at the top level object being stored or would the interceptor be called on each object in the graph that is being serialized? It sounds like the former which is the hole in my original thinking. I need to check for autowiring *each* object that is placed in the cache whether directly or via object references.
I did implement the v5 Externalizer solution and it has worked great. It is dependent on a ThreadLocal but the design works well and the Externalizers are easy enough to implement.
Thanks!
Regards,
John
-
3. Re: How to re-autowire/inject transient fields from Spring/IoC during deserialization?
galder.zamarreno Sep 28, 2011 3:07 AM (in response to johncommon)The interceptor gets called once per each cache.put() or equivalent op, not whenever an object of the graph is going to be serialized.
Nice to hear that the Externalizer extensions introduced in 5.0 are helping here. Is this code available somewhere?