true, but you can override writereplace() and readresolve() to keep it a singleton. further, even though it is no longer a singleton within a given page there will be only one instance of it even when serialized/deserialized, so you still get some memory savings.
-igor On Wed, Dec 5, 2012 at 9:37 AM, Dan Retzlaff <[email protected]> wrote: > Might be worth noting that as soon as it goes through a serialization > round-trip it's no longer a singleton. Not a concern for a trivial > AttributeAppender, but it's a Wicket+static+serialization gotcha we learned > the hard way. :) > > On Wed, Dec 5, 2012 at 4:40 PM, Igor Vaynberg <[email protected]>wrote: > >> yes, you can use singleton instances as long as they are threadsafe. >> >> -igor >> >> On Wed, Dec 5, 2012 at 2:40 AM, Davli <[email protected]> wrote: >> > Well as the title says... >> > Would this be possible assuming that they have have no real relation to a >> > value in a session? >> > For example: >> > >> > An AttributeAppender that always appends the same value. >> > >> > >> > >> > -- >> > View this message in context: >> http://apache-wicket.1842946.n4.nabble.com/Possible-to-use-static-IBehavior-ReadOnlyModels-tp4654507.html >> > Sent from the Users forum mailing list archive at Nabble.com. >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: [email protected] >> > For additional commands, e-mail: [email protected] >> > >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
