how to use Guice in serializable context

377 views
Skip to first unread message

mc

unread,
Jan 31, 2010, 8:51:53 AM1/31/10
to google-guice
Hi,

I'd like to use Guice to inject dependencies (e.g. Services) into
classes that got serialized at runtime (by framework != WICKET). I
wouldn't want to make all my injected dependencies implementing
Serializable interface. I tried static injection - that worked but I
do not find it the correct way. I tried using build in provider but
that isn't serializable.

Does anyone can have a solution that would help me.

Many thanks!

M.C.

Dhanji R. Prasanna

unread,
Jan 31, 2010, 6:01:28 PM1/31/10
to google...@googlegroups.com
You're looking for readResolve:

Dhanji.


--
You received this message because you are subscribed to the Google Groups "google-guice" group.
To post to this group, send email to google...@googlegroups.com.
To unsubscribe from this group, send email to google-guice...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-guice?hl=en.


Eelco Hillenius

unread,
Jan 31, 2010, 6:31:59 PM1/31/10
to google...@googlegroups.com
You'd have to either do that - again and again - or use a Wicket-like
trick where you abstract re-getting of a value when you deserialize
behind a proxy.

Eelco

mc

unread,
Feb 3, 2010, 2:26:56 AM2/3/10
to google-guice
okay thanks - I'll check the Wicket-like approach maybe I can get this
work.

M.C.

On Feb 1, 12:31 am, Eelco Hillenius <eelco.hillen...@gmail.com> wrote:
> You'd have to either do that - again and again - or use a Wicket-like
> trick where you abstract re-getting of a value when you deserialize
> behind a proxy.
>
> Eelco
>
> On Sun, Jan 31, 2010 at 3:01 PM, Dhanji R. Prasanna <dha...@gmail.com> wrote:
>
>
>
> > You're looking for readResolve:
> >http://java.sun.com/j2se/1.5.0/docs/api/java/io/Serializable.html
> > Dhanji.
>

Reply all
Reply to author
Forward
0 new messages