On Thu, Sep 15, 2011 at 10:58 PM, Reinhard Pötz <[email protected]> wrote:
> On 09/15/2011 08:40 PM, Sander Sõnajalg wrote:
>>
>> On Thu, Sep 15, 2011 at 8:51 PM, Martin
>> Grigorov<[email protected]>wrote:
>>
>>> Sorry, I went a bit far.
>>> You need to re-call just #init() without #internalInit(), so
>>> #internalDestroy() is not really needed.
>>>
>>> Usually #init() mounts the pages and configures different IXyzSettings
>>> but it can contain any user specific code so I think it is not that
>>> safe to be re-called.
>>>
>>> Even with @Mount someone have to re-run the scanner and if the impl is
>>> the same as it is now the registry with mappers will be doubled.
>>>
>>> I see no way to archive what you need at the moment.
>>>
>>
>>
>> Thanks a lot for your answers! : )
>>
>> Trying to support @Mount is probably our way to go here, if we want to
>> enhance our wicket support. Re-calling init() sounds very unsafe and this
>> is
>> probably unacceptable, but patching various resource scanners is something
>> we have done for numerous frameworks already, this should be feasible if
>> the
>> need for this functionality seems to be high enough. Thanks!
>
> IIUC this means Wicket's o.a.w.request.mapper.ICompoundRequestMapper
> interface would have to provide a #clear() method.
This is not so simple too because it will remove the system mappers too.
But even if it cleans just the user defined mappers then what about
your custom application specific logic in #init(). How to revert and
re-apply it safely ?

I think it is not worth the troubles.
Application#init() is modified rarely. Only in the early development
phase a man needs to add something there. With the time you'll edit
more components and more rarely the configuration.

Here is a workaround that you can use to mount a newly created page:
in code which you know will execute for sure (e.g. another page's
#onBeforeRender()) you can add
WebApplication.get().mountPage("some/path", TheNewPage.class) then
fire a request once and then remove that line.

>
> Then the JRebel Wicket plugin could call it so that there are no double
> mounts.
>
> However, after looking at the mentioned AnnotatedMountScanner
> (http://goo.gl/AY6Ap) I'm not sure how the JRebel Wicket plugin would know
> how to re-run the scanner which is usually called by
>
> new AnnotatedMountScanner().scanPackage("com.example.*").mount(this);
>
> Any ideas?
>
> --
> Reinhard Pötz         Founder & Managing Director, Indoqa and Deepsearch
>                        http://www.indoqa.com/people/reinhard-poetz.html
>
> Member of the Apache Software Foundation
> Apache Cocoon Committer, PMC member                  [email protected]
> ________________________________________________________________________
>
>      Furthermore, I think Oracle has to honor the JSPA agreement.
>    http://s.apache.org/JCPIsDead       http://s.apache.org/tck-trap
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

Reply via email to