|
From: Eugene K. <eu...@pl...> - 2006-06-24 14:21:10
|
Bob, You probably won't want to use something like that. But with Terracotta for Sessions product you can put non-serializable objects into session. Version for Tomcat is free for up to 4 nodes. See http://www.terracottatech.com/ Otherwise, using AOP to inject dependencies on deserialization. This will be quite similar to @Configurable added in Spring 2.0. Would require an AspectJ though... regards, Eugene Bob Lee wrote: > I'm injecting an object which will be stored in the HTTP session which > means it needs to be serializable. I want to inject a non-serializable > singleton into the session object. > > Option A: Keep a transient reference to the singleton. What to I do > when the object deserializes? Do I re-inject it from the readObject() > method? How? How do I re-inject only transient references? > > Option B: Inject a static reference. Does Spring support this? > > What is the "Spring Way" here? > > Bob |