PageStore listener...

2007-08-23 Thread Jan Kriesten

Hi,

is there a way to add a listener to PageStore events (storePage/getPage)?

I'm still looking for a clean way to re-inject Pages/Components when they are
deserialized. This way I could just set some fields transient and have them
injected again if necessary.

I gave IComponentOnBeforeRenderListener a look as a hook to do this, but that is
called _after_ Components onBeforeRender(), so it's not usable for that.

Regards, --- Jan.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: PageStore listener...

2007-08-23 Thread Matej Knopp
Why can't you just implement read/writeObject on your page/component?

-Matej

On 8/23/07, Jan Kriesten [EMAIL PROTECTED] wrote:

 Hi,

 is there a way to add a listener to PageStore events (storePage/getPage)?

 I'm still looking for a clean way to re-inject Pages/Components when they are
 deserialized. This way I could just set some fields transient and have them
 injected again if necessary.

 I gave IComponentOnBeforeRenderListener a look as a hook to do this, but that 
 is
 called _after_ Components onBeforeRender(), so it's not usable for that.

 Regards, --- Jan.



 -
 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]



Re: PageStore listener...

2007-08-23 Thread Johan Compagner
Or make the fields itself not transient, but a proxy that has a transient
field
and the proxy can deserialize and inject itself again (see wicket-ioc
project)

johan


On 8/23/07, Matej Knopp [EMAIL PROTECTED] wrote:

 Why can't you just implement read/writeObject on your page/component?

 -Matej

 On 8/23/07, Jan Kriesten [EMAIL PROTECTED] wrote:
 
  Hi,
 
  is there a way to add a listener to PageStore events
 (storePage/getPage)?
 
  I'm still looking for a clean way to re-inject Pages/Components when
 they are
  deserialized. This way I could just set some fields transient and have
 them
  injected again if necessary.
 
  I gave IComponentOnBeforeRenderListener a look as a hook to do this, but
 that is
  called _after_ Components onBeforeRender(), so it's not usable for that.
 
  Regards, --- Jan.
 
 
 
  -
  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]




Re: PageStore listener...

2007-08-23 Thread Jan Kriesten

hi matej, hi johan,

 Why can't you just implement read/writeObject on your page/component?

that would be an effort... here a listview, there a link and over there another
image...

that way i loose all the benefits of using injection - i build new logic in the
components which i just wanted to get rid of.

 Or make the fields itself not transient, but a proxy that has a transient
 field and the proxy can deserialize and inject itself again (see wicket-ioc
 project)

possible, but that reminds me on the 'XYService.getInstance()' usage in the
times before IoC. it adds another indirection which makes should-be-easy things
more complex. instead of being able to just inject the right class instances, i
have to use proxies (so being on the save side when changing
classes/implementations break serialization).

there's the onComponentInstantiationListener() - easy to use and powerful. if
there would be some listener being called before any other component logic is
being performed that would be great. it would be enough to call this once during
a request-cycle to minimize the overhead.

btw, why is the OnBeforeRenderListener called after and not before
OnBeforeRender() of the component?

regards, --- jan.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: PageStore listener...

2007-08-23 Thread Igor Vaynberg
On 8/23/07, Jan Kriesten [EMAIL PROTECTED] wrote:


 hi matej, hi johan,

  Why can't you just implement read/writeObject on your page/component?

 that would be an effort... here a listview, there a link and over there
 another
 image...

 that way i loose all the benefits of using injection - i build new logic
 in the
 components which i just wanted to get rid of.

  Or make the fields itself not transient, but a proxy that has a
 transient
  field and the proxy can deserialize and inject itself again (see
 wicket-ioc
  project)

 possible, but that reminds me on the 'XYService.getInstance()' usage in
 the
 times before IoC. it adds another indirection which makes should-be-easy
 things
 more complex. instead of being able to just inject the right class
 instances, i
 have to use proxies (so being on the save side when changing
 classes/implementations break serialization).


really, so this is too complicated?

public mypanel extends panel {
@SpringBean private Service service;

...
}

 -igor


regards, --- jan.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: PageStore listener...

2007-08-23 Thread Jan Kriesten

hi igor,

 public mypanel extends panel {
 @SpringBean private Service service;

actually, if i use guice-injection

@Inject private ContentManager cm;

where ContentManager isn't serializable, i get tons of exceptions regarding 'not
serializable.

so, to me it seems that the proxy-stuff not always applies.

i wouldn't have asked if i hadn't had any trouble with this.

regards, --- jan.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: PageStore listener...

2007-08-23 Thread Igor Vaynberg
are you using wicket-guice? or just the guice' raw injection?

-igor


On 8/23/07, Jan Kriesten [EMAIL PROTECTED] wrote:


 hi igor,

  public mypanel extends panel {
  @SpringBean private Service service;

 actually, if i use guice-injection

 @Inject private ContentManager cm;

 where ContentManager isn't serializable, i get tons of exceptions
 regarding 'not
 serializable.

 so, to me it seems that the proxy-stuff not always applies.

 i wouldn't have asked if i hadn't had any trouble with this.

 regards, --- jan.



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]