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. 2011/9/15 Sander Sõnajalg <[email protected]>: > Hi! > > I think this discussion was started by our support being asked whether it > would be possible to reload the statements that mount the bookmarkable > pages, typically placed in a method overriding Application#init(). Let's > even leave garbage collection aside for a moment.. JRebel is a > developer-oriented product and the developer will probably be running his > instance of wicket in an isolated web server where he is the only user and > he'll be restarting he server at least once a day anyway... memory is > usually not a problem. I mean.. re-calling Application#init() is something > that user can override to do whatever custom application initialization > logics he wants, right? And quite probably some guys will use it to > initialize some singleton services or other stuff they really expect to only > get called once? I'm afraid there is no way we could assume that re-calling > Application#init is safe, even if there is no wicket-interals-specific > reason that disallows recalling it (is there?). Situation would have been > better if mounting those bookmarkable pages would have been implemented by > some sort of @Mount annotations on top of the Page classes (I haven't > followed recent developments of wicket.. i don't know whether you have this > option or not). But currently, i think this kind of reloading is not safely > doable, or what you guys think..? > > Sander Sõnajalg > (JRebel development team) > > > On Thu, Sep 15, 2011 at 6:51 PM, Reinhard Pötz <[email protected]> wrote: > >> >> Do I understand your comment correctly that you are worried about wasting >> resources, i.e. mounted mappers that don't get garbage collected? >> >> Or do you also expect that after #internalDestroy() #init() the application >> doesn't work as expected anymore? >> >> -- Reinhard >> >> On 09/15/2011 05:08 PM, Martin Grigorov wrote: >> >>> Hi, >>> >>> I've heart about problems with Wicket page reload and component tree >>> before but this question about reloading the configuration >>> (Application class) is new for me. >>> >>> I haven't tried it but before calling #init() I would call >>> #internalDestroy(). But even with this I think it wont work because >>> destroy method calls different destroy callbacks for the configurable >>> parts of Wicket but it doesn't clean data structures like the list of >>> mounted mappers. We leave this to the garbage collector. >>> The mount problem can be solved with #umount(String) but only if you >>> know the mount path, so again it is not enough... >>> >>> On Thu, Sep 15, 2011 at 5:56 PM, Reinhard Pötz<[email protected]> >>> wrote: >>> >>>> >>>> Yesterday I started with a new Wicket 1.5 project and since the >>>> ReloadingClassLoader didn't work for me I gave JRebel a try. AFAICT >>>> JRebel >>>> worked great when you change existing classes. But then I run into a >>>> problem >>>> when I added a mount to the Wicket application. >>>> >>>> I contacted the JRebel support and they answered promptly. You can find >>>> our >>>> conversation below. >>>> The mentioned code sample can be found at >>>> https://github.com/reinhard/**wicket-jrebel<https://github.com/reinhard/wicket-jrebel> >>>> >>>> In short, they are asking whether it is ok to call the init() method of >>>> the >>>> WebApplication object again when the class file was changed. >>>> >>>> Unfortunately I'm not an expert in how Wicket works internally and >>>> whether >>>> it is save what they propose. >>>> >>>> It would be great if somebody else with a better understanding of >>>> possible >>>> implications of this call could share his thoughts with us. >>>> Please keep the ZeroTurnaround Support Team in the loop by CCing them. >>>> >>>> -- Reinhard >>>> >>>> On 09/15/2011 01:07 PM, ZeroTurnaround Support Team wrote: >>>> >>>>> >>>>> Hello, >>>>> >>>>> Thank you very much for the demo application. >>>>> >>>>> As the page is mounted in the init() method the only solution for >>>>> this problem would be to call this method when a class extending >>>>> org.apache.wicket.Application is changed. Can you predict what >>>>> problems may arise if we do this? It seems that if multiple pages are >>>>> mounted to same path the last one is used, so there should be no >>>>> problems with remounting pages. What else can be done in the init() >>>>> method except mounting pages? >>>>> >>>>> -- Aleksei Sosnovski [email protected] >>>>> >>>>> >>>>> -----Original Message----- From: "Reinhard >>>>> Pötz"<[email protected]> Reply-To: "Reinhard >>>>> Pötz"<[email protected]> Date: Wed, 14 Sep 2011 22:58:17 +0200 To: >>>>> "ZeroTurnaround Support >>>>> Team"<support@zeroturnaround.**com<[email protected]>> >>>>> Subject: >>>>> Re: (Case 16581) JRebel Wicket-Integration >>>>> >>>>> Hello Anton! >>>>>> >>>>>> Thanks for your really fast answer! I've created a small >>>>>> test-project based on the Wicket Quickstart archetype, which is >>>>>> attached to this mail. >>>>>> >>>>>> Run 'mvn package eclipse:eclipse' in order to get a working >>>>>> project configuration for Eclipse and JRebel. Then run the main >>>>>> method of the class com.example.Start with JRebel being activated. >>>>>> The reload of existing pages works fine AFAICS (at least some >>>>>> simple experiments worked well for me). >>>>>> >>>>>> Then go to the class com.example.WicketApplication and uncomment >>>>>> the commented line that mounts a page. As I explained in my mail >>>>>> before, the new page isn't found although the log and the console >>>>>> output confirm that the WicketApplication class has been reloaded >>>>>> before. >>>>>> >>>>>> If you have any further questions, don't hesitate to contact me! >>>>>> >>>>>> Best regards, Reinhard Pötz >>>>>> >>>>>> On 09/14/2011 06:18 PM, ZeroTurnaround Support Team wrote: >>>>>> >>>>>>> >>>>>>> Hello! >>>>>>> >>>>>>> It might be the case that this particular functionality is not >>>>>>> covered with our integration. JRebel picks up the new version of >>>>>>> the class but probably it is required to reinitialize some of the >>>>>>> Wicket internals. >>>>>>> >>>>>>> Can you provide me the sample test case for this issue? >>>>>>> >>>>>>> -- Anton Arhipov [email protected] >>>>>>> >>>>>> >>>> -- >>>> Reinhard Pötz Founder& Managing Director, Indoqa and Deepsearch >>>> http://www.indoqa.com/people/** >>>> reinhard-poetz.html <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 >>>> >>>> >>> >>> >>> >> >> -- >> Reinhard Pötz Founder & Managing Director, Indoqa and Deepsearch >> >> http://www.indoqa.com/people/**reinhard-poetz.html<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
