Thanks a lot !
I can clean up my test code now :)

Regards
Mridul

Kyle Marvin wrote:

Just checked in the fix as 161352, so we can shortcut JIRA on this one :)

-- Kyle

On 4/14/05, Mridul Muralidharan <[EMAIL PROTECTED]> wrote:


I was going to mention the same to you actually !
I was testing a @ControlInterface extending another @ControlInterface
and adding some methods to it.
The parts that I actually wanted to test worked great - except that I
had serialization issues 'cos of what I mentioned.

I was trying to validate whether for the plain case whether I had
noticed anything else too - cant find anything else now.

Thanks,
Mridul

Kyle Marvin wrote:



Is your control doing implementation inheritance?  I just noticed that
in the ImplInitializer codegen template it has the following:

  public void initServices(ControlBean bean, Object target)
  {
      ...

      super.initServices(bean, impl);

but there is no corresponding superclass delegation in resetServices.
This means that if you have an impl that extends another impl that has
contextual services, then the superclass services wouldn't be reset
properly.

-- Kyle

On 4/14/05, Kyle Marvin <[EMAIL PROTECTED]> wrote:




What I found out is that "public void initServices(ControlBean bean,
Object target)" in the generated ImplInitializer has all the dependency
injection done properly : Context , ResourceContext , etc.
While for "public void resetServices(ControlBean bean, Object target)" ,
only the context was getting reset to null.
I think this is the reason why I observed the attempts to serialize a
ResourceContextImpl - since the field was not getting reset to null.
So , this would mean that we would typically need to reset all resource
we injected in initServices while executing resetServices.
Please correct me if my understanding is wrong.




Nope, your understanding is right, and service initialization and
reset in generated ImplInitializer classes should be symmetrical.
This sounds like a codegen bug, but there is a checkin test
(BaseContextImpl.jcs) that covers this area and it seems to be
generating properly, so there may be something more specific to your
Impl that is triggering it.

Please open a JIRA issue on this and attach the code-generated
ImplInitializer.java file and  at least a code-fragment that shows
your @Context declarations.

Thanks!

-- Kyle





Reply via email to