round 1 of refactoring is in. its much more elegant now. feedback please.

-Igor


On 11/8/05, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
thats pretty much exactly what i was thinking.

-Igor


On 11/8/05, Christian Essl <[EMAIL PROTECTED] > wrote:
Very good. I am still playing around with the writeReplace thing.

Regarding the refactoring what do you thing about this:

Instead of the ISpringContextLocator have a

interface ObjectResolverFactory{
  ObjectResolver getObjectResolver(Field field);
}

interface ObjectResolver{
   Object resolve();
}

The (Spring)Initializer than calls for *each* field the
ObjectResolverFactory. If the ObjectResolverFactory thinks the field is
suitable for injection (ie has a SpringBean Annotation or JNDI Annotation)
it returns an ObjectResolver otherwise null.

And the code which creates the proxy could than be
ProxyCreator.create(Class proxyType, ObjectResolver res).

This would than make my wrapping context very simple.

Thanks,
Christian

On Tue, 8 Nov 2005 13:45:31 -0800, Igor Vaynberg < [EMAIL PROTECTED]>
wrote:

> ok, got the pure cglib solution working.
> just had to call enhancer.setInterfaces(new Class[]
> { Serializable.class})
> to weave in the serializable interface.
>
> now it appears everything is working. sweet.
> i am going to do a lot of refactoring today. maybe you can make your
> wrappingcontext use the same proxies as this thing so we can keep it all
> in
> one place.
>
> -Igor
>
>
> On 11/8/05, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
>>
>> I would rather weave it in using cglib and stay away from a
>> spring-specific proxy impl, becuase this thing can easily be
>> generalized to
>> things beyound spring, like jndi lookups, etc.
>>
>> -Igor
>>
>>
>> On 11/8/05, Christian Essl < [EMAIL PROTECTED]> wrote:
>> >
>> > On Tue, 8 Nov 2005 11:59:22 -0800, Igor Vaynberg <
>> > [EMAIL PROTECTED]>
>> > wrote:
>> >
>> > > Im still getting a class cast exception using cglib directly. im
>> > probably
>> > > doing something dumb, you want to take a look? SpringInitializer
>> line
>> > 61
>> > > is
>> > > commented out, thats where proxies are created for concrete objects.
>> >
>> > I think the problem is in the SpringLazyLookupInterceptor.intercept ()
>> > method you should at the
>> > end call proxy.invoke(target, args) instead of proxy.invokeSuper().
>> > invokeSuper expects that the given argument is the enhanced instance.
>> > You
>> > need it to call methods on the super (original) class.
>> >
>> > >
>> > > By the way, the spring one works fine IF the dependency implements
>> > > Serializable, because then the proxy itself becomes serializable
>> since
>> > > its a
>> > > subclass. so im wondering if we can just weave in that interface
>> into
>> > the
>> > > created subclass and that will solve our problem. what do you think?
>> >
>> > That seems reasonable. I'll post a question on the spring list and see
>> > what they say.
>> >
>> > Christian
>> >
>> > >
>> > > -Igor
>> > >
>> > >
>> > > On 11/8/05, Christian Essl < [EMAIL PROTECTED]> wrote:
>> > >>
>> > >> I do not know wheter read/writeObject is called on objects
>> referenced
>> > >> from
>> > >> session attributes ("full serialization closure"). However the spec
>> > does
>> > >> not speak about writeReplace()
>> > >> and readResolve() so 'legaly' you should be on the right side if
>> you
>> > >> rely
>> > >> on these.
>> > >>
>> > >> Enclosed is some code which I guess does what is described on the
>> > cglib
>> > >> howto page. I have not tested the code yet. I'll try to do so until
>> > >> tomorrow.
>> > >>
>> > >> Anyway is it so important to inject objects without interfaces?
>> > >>
>> > >> Christian
>> > >>
>> > >> On Tue, 8 Nov 2005 09:07:24 -0800, Igor Vaynberg
>> > >> < [EMAIL PROTECTED]>
>> > >> wrote:
>> > >>
>> > >> > got the proxies for concrete objects working, but another dead
>> end
>> > >> > unfortunately. seems cglib proxies are not serializable objects.
>> in
>> >
>> > >> their
>> > >> > howto they recommend overriding read/write resolve and
>> > reconstructing
>> > >> the
>> > >> > proxy, but those are not guaranteed to be called when nonstandard
>> > >> > serialization is used. not sure where to go from here
>> > >> >
>> > >> > -Igor
>> > >> >
>> > >> >
>> > >>
>> > >>
>> >
>> >
>> >
>> > --
>> > Christian Essl
>> >
>> >
>> >
>> >
>> >
>> > ___________________________________________________________
>> > Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier
>> > anmelden: http://mail.yahoo.de
>> >
>> >
>> >
>> > -------------------------------------------------------
>> > SF.Net email is sponsored by:
>> > Tame your development challenges with Apache's Geronimo App Server.
>> > Download
>> > it for free - -and be entered to win a 42" plasma tv or your very own
>> > Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
>> > _______________________________________________
>> > Wicket-user mailing list
>> > Wicket-user@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/wicket-user
>> >
>>
>>



--
Christian Essl





___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Reply via email to